Skip to content
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

handle statistics update even if statistics dict not initialized #508

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

2timesjay
Copy link

Issue: #507

Handle KeyError that occurs in edge cases by changing instances of self.statistics[key] += ... to self.statistics[key] = self.statistics.get(key, ...) + ...

This will eliminate keyerrors.

In the cases where statistics isn't initialized with begin(), this will still not ensure that it's correct, but will ensure that we retry instead of crashing.

Alternately,

            self.statistics["idle_for"] = rs.idle_for
            self.statistics["attempt_number"] = rs.attempt_number

might be more accurate.

Copy link
Contributor

mergify bot commented Jan 14, 2025

⚠️ No release notes detected. Please make sure to use reno to add a changelog entry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant