-
-
Notifications
You must be signed in to change notification settings - Fork 483
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
Memoize session.aggregation_key #1892
Conversation
Codecov ReportBase: 98.40% // Head: 98.39% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1892 +/- ##
==========================================
- Coverage 98.40% 98.39% -0.02%
==========================================
Files 148 148
Lines 8886 8885 -1
==========================================
- Hits 8744 8742 -2
- Misses 142 143 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
Please also add a changelog entry, thx
@pending_aggregates[session.aggregation_key] ||= init_aggregates(session.aggregation_key) | ||
@pending_aggregates[session.aggregation_key][session.status] += 1 | ||
|
||
aggregation_key = session.aggregation_key |
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.
Should the aggregation_key
method memoizes its value then? Or should we rename it to generate_aggregation_key
?
The fact that a *_key
method generates different value every time it's called feels like a trap to me.
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.
wait no, I was just fixing this blindly. The key should not change because it always picks started
, wtf.
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'm not sure how else this error could happen then, I will memoize anyway and let's see if it fixes this user's problem.
403daeb
to
dedd055
Compare
probably fixes #1891
(this is the only hypothesis I have currently for that error happening)