Skip to content

Commit

Permalink
Correct Style/IfUnlessModifier offense in jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
David Kang committed Aug 20, 2020
1 parent 2838241 commit f640c04
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
1 change: 0 additions & 1 deletion src/api/.rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1365,7 +1365,6 @@ Style/IfUnlessModifier:
- 'app/controllers/webui/search_controller.rb'
- 'app/controllers/webui/users/notifications_controller.rb'
- 'app/controllers/webui/webui_controller.rb'
- 'app/jobs/status_history_rescaler_job.rb'
- 'app/mailers/event_mailer.rb'
- 'app/mixins/build_log_support.rb'
- 'app/mixins/has_attributes.rb'
Expand Down
4 changes: 1 addition & 3 deletions src/api/app/jobs/status_history_rescaler_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ class StatusHistoryRescalerJob < ApplicationJob
# this is called from a delayed job triggered by clockwork
def perform
maxtime = StatusHistory.maximum(:time)
if maxtime
StatusHistory.where('time < ?', maxtime - 365 * 24 * 3600).delete_all
end
StatusHistory.where('time < ?', maxtime - 365 * 24 * 3600).delete_all if maxtime

keys = StatusHistory.distinct.pluck(:key)
keys.each do |key|
Expand Down

0 comments on commit f640c04

Please sign in to comment.