Fix multiple workers for the same scheduled status being queueable (#9875)

master
Eugen Rochko 6 years ago committed by GitHub
parent 6b91da97bb
commit 31e7940de5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      app/workers/publish_scheduled_status_worker.rb

@ -3,6 +3,8 @@
class PublishScheduledStatusWorker class PublishScheduledStatusWorker
include Sidekiq::Worker include Sidekiq::Worker
sidekiq_options unique: :until_executed
def perform(scheduled_status_id) def perform(scheduled_status_id)
scheduled_status = ScheduledStatus.find(scheduled_status_id) scheduled_status = ScheduledStatus.find(scheduled_status_id)
scheduled_status.destroy! scheduled_status.destroy!

Loading…
Cancel
Save