Skip to content

Commit

Permalink
Set unique_expiration timeout for course update workers
Browse files Browse the repository at this point in the history
By default, unique job locks expire after 30 minutes, so duplicate jobs have been accumulating on P&E Dashboard, where updating all current courses takes longer than that.
  • Loading branch information
ragesoss committed Mar 20, 2018
1 parent e97d6ee commit 04a67da
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/workers/course_data_update_worker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
require_dependency "#{Rails.root}/app/services/update_course_stats"

class CourseDataUpdateWorker
THIRTY_DAYS = 60 * 60 * 24 * 30
include Sidekiq::Worker
sidekiq_options unique: :until_executed
sidekiq_options unique: :until_executed, unique_expiration: THIRTY_DAYS

This comment has been minimized.

Copy link
@djones

djones Apr 29, 2018

You could just make this 30.days.to_i


def self.update_course(course_id:, queue:)
CourseDataUpdateWorker.set(queue: queue).perform_async(course_id)
Expand Down

0 comments on commit 04a67da

Please sign in to comment.