-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Monitor funds and re-enable disabled orgs #481
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
having the default "re-enable" monitor period be in minutes without a comment or using "min" in the name is waiting to trip someone up (especially when i think we typically use seconds as our duration number).
i would minimum make a comment or name that setting to indicate minutes is the expect time scale but preferably i would document that setting is expected in seconds and make the default settings function 60 * 30
iot_packet_verifier/src/verifier.rs
Outdated
let mut org_cache = HashMap::new(); | ||
loop { | ||
tracing::info!("Checking if any orgs need to be re-enabled"); | ||
|
||
// Fetch all disables orgs: | ||
let mut disabled_clients = HashSet::new(); | ||
let orgs = client | ||
.lock() | ||
.await | ||
.client | ||
.list(OrgListReqV1 {}) | ||
.await | ||
.map_err(OrgClientError::RpcError)? | ||
.into_inner(); | ||
for org in orgs.orgs { | ||
if org.locked { | ||
disabled_clients.insert(org.oui); | ||
let payer = client.fetch_org(org.oui, &mut org_cache).await?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't see you using disabled_clients
anywhere, you're just inserting into it and then dropping it at the end of each loop?
also, i don't think you need the outer org_cache
any longer since you're calling org list
on each run and that's sending you back the org record, including the payer
field you're using to query solana. unlike the other, you are using this cache from one run to the next, but since you're always calling the org list
command and getting back the same info you need the cache isn't doing anything for you
No description provided.