Add rake task to delete stats keys set to 0#250
Conversation
unleashed
left a comment
There was a problem hiding this comment.
Check out the comments for some minor changes needed - also s/func/method/g in commit messages :)
And also, move what's not under the ".delete" describe block.
10dd24c to
7e5d339
Compare
5d8a9e1 to
849ac3f
Compare
|
@unleashed please check the 3 new commits. |
unleashed
left a comment
There was a problem hiding this comment.
Ok, but check the few comments I made. I think there is some more room for improvement but the affected code does not merit the extra effort.
| retries ||= 0 | ||
| return yield | ||
| rescue Exception => e | ||
| retry if (retries += 1) < MAX_RETRIES_REDIS_ERRORS |
There was a problem hiding this comment.
😲 This line is a bit surprising. How is this following your usual readability policy? Why don't you just extract the increment to a statement before the retry check?
There was a problem hiding this comment.
I don't have a strong opinion about this. You would have complained either way ![]()
To avoid mixing the errors with the deleted keys.
c836a3d to
25d3766
Compare
|
bors r=@unleashed |
|
🕐 Waiting for PR status (Github check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
|
bors retry |
|
Build succeeded: |
This PR adds a rake task to delete the stats keys set to 0. Those keys are useless and occupy Redis memory unnecessarily. They were generated by the bug that was fixed in #247