Skip to content

lock: :until_and_while_executing not working for scheduled jobs #334

@macmartine

Description

@macmartine

Describe the bug
Duplicate jobs are getting run when scheduling jobs using perform_at

Expected behavior
When a job is scheduled to be run in the future, and a job with the same arguments gets called, it shouldn't be added to the schedule.

Current behavior
Duplicate jobs are added and run.

Worker class

class SequenceActionWorker

  include Sidekiq::Worker
  include Sidekiq::Status::Worker

  sidekiq_options queue: 'default', retry: false, lock: :until_and_while_executing

  def perform id
    Api::ActionPerformerService.new id
  end

end

The jobs are getting executed with:

SequenceActionWorker.perform_at(Time.now + 5.minutes, some_id)

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions