-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add rake task for cleaning up sidekiq batch keys #3912
Conversation
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'd rather put this under lib/
because it is not used by the server at runtime.
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.
yeah, true!
@akostadinov I applied some changes... |
Ah, yeah, I added as |
c261046
to
a96314b
Compare
81923e2
to
af428f2
Compare
Apply suggestions from code review Co-authored-by: Aleksandar N. Kostadinov <akostadinov@gmail.com>
af428f2
to
52504ea
Compare
lib/tasks/sidekiq/cleanup.rake
Outdated
params = args[:max_age_seconds] ? { max_age_seconds: Integer(args[:max_age_seconds]) } : {} | ||
|
||
message = params[:max_age_seconds] ? "#{params[:max_age_seconds].seconds.in_hours} hours" : "the default age" | ||
puts "Cleaning up the sidekiq-batch BID-* keys older than #{message}" |
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 think that we don't need this logging given that SidekiqBatchCleanupService already logs it with the actual value, not just the default age". btw
putsfor logging is not recommended. Using a logger or at least
warn` is better becaue it will not go to stdout.
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.
done
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.
Thanks!
* Add rake task for cleaning up sidekiq batch keys Apply suggestions from code review Co-authored-by: Aleksandar N. Kostadinov <akostadinov@gmail.com> * Remove unnecessary logs * Refactoring --------- Co-authored-by: Aleksandar N. Kostadinov <akostadinov@gmail.com>
What this PR does / why we need it:
Add a rake task to cleanup
BID-*
keys.Which issue(s) this PR fixes
Related to https://issues.redhat.com/browse/THREESCALE-8124
Verification steps
Special notes for your reviewer: