-
Notifications
You must be signed in to change notification settings - Fork 420
Async background processor check_sleeper refactor #3978
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
Async background processor check_sleeper refactor #3978
Conversation
This makes it impossible to forget to reinitialize the sleeper and poll a future that is already ready.
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3978 +/- ##
==========================================
- Coverage 88.91% 88.90% -0.01%
==========================================
Files 174 174
Lines 124232 124230 -2
Branches 124232 124230 -2
==========================================
- Hits 110455 110447 -8
- Misses 11301 11303 +2
- Partials 2476 2480 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Rustfmt is not always processing macros.
let prune_timer = if gossip_sync.prunable_network_graph().is_some() { | ||
NETWORK_PRUNE_TIMER | ||
} else { | ||
FIRST_NETWORK_PRUNE_TIMER | ||
}; | ||
let prune_timer_elapsed = { | ||
match check_sleeper(&mut last_prune_call) { | ||
match check_and_reset_sleeper(&mut last_prune_call, || sleeper(prune_timer)) { |
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.
wouldn't this cause the first prune after 60s to not run in the GossipSync::P2P
case? since it will override last_prune_call
with sleeper
after NETWORK_PRUNE_TIMER
.
Edit: ignore, it won't.
"Error: Failed to persist scorer, check your disk and permissions {}", | ||
e, | ||
); | ||
log_error!(logger, "Error: Failed to persist scorer, check your disk and permissions {}", e); |
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.
this similar log msg from the async version can be fixed as well
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.
Straightforward cleanup.
This makes it impossible to forget to reinitialize the sleeper and poll a future that is already ready.