-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat: VoterApi::vote
now returns an Option.
#5589
feat: VoterApi::vote
now returns an Option.
#5589
Conversation
3a8402d
to
3dda26b
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5589 +/- ##
======================================
- Coverage 71% 71% -0%
======================================
Files 511 511
Lines 90565 90479 -86
Branches 90565 90479 -86
======================================
- Hits 64429 64317 -112
- Misses 23595 23619 +24
- Partials 2541 2543 +2 ☔ View full report in Codecov by Sentry. |
The voter api can now signal that it doesn't have anything to vote for by returning `Ok(None)`. Previously, in such cases we had to return `Err(..)`, which lead to the RetrierClient scheduling an exponential backoff.
3dda26b
to
afd2e97
Compare
engine/src/elections.rs
Outdated
@@ -176,6 +176,9 @@ where | |||
|
|||
pending_submissions.insert(election_identifier, (partial_vote, vote)); | |||
}, | |||
Ok(None) => { | |||
info!("Voting task for election '{:?}' returned 'None' (nothing to submit).", election_identifier); |
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.
nit: I feel like debug would be more appropriate here otherwise we'll see a lot of spam.
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.
info!("Voting task for election '{:?}' returned 'None' (nothing to submit).", election_identifier); | |
debug!("Voting task for election '{:?}' returned 'None' (nothing to submit).", election_identifier); |
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.
Agree re: the log level otherwise looks good 👍
Pull Request
Closes: PRO-1979
Checklist
Please conduct a thorough self-review before opening the PR.
Summary
The voter api can now signal that it doesn't have anything to vote for by returning
Ok(None)
. Previously, in such cases we had to returnErr(..)
, which lead to the RetrierClient scheduling an exponential backoff.