Skip to content
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

Tasks run once, and then there is no launch #464

Closed
danilvoe opened this issue Dec 16, 2019 · 5 comments
Closed

Tasks run once, and then there is no launch #464

danilvoe opened this issue Dec 16, 2019 · 5 comments
Assignees

Comments

@danilvoe
Copy link

  1. I add a task.
  2. It is scheduled
  3. When the time comes for repeated execution it does not work, in the logs at this moment the inscription appears - the unique_key: uniquejobs:eb3c5540017ce14b28c087bb550569fb is not locked, allowing job to silently complete

If the tasks are launched through the sidekiq interface, then the launch occurs, but according to the schedule, the task does not start.

If you delete a task from the schedule and re-set them, then they are started, but only once.

worker defined:

class InternalProcessWorker
    include Sidekiq::Worker
    sidekiq_options lock: :until_executed, queue: :internal_manager, retry: false, backtrace: true

create job:

Sidekiq::Cron::Job.new...
if new_job.valid?
                    new_job.save
end

what am I doing wrong?

gem 'sidekiq', '5.2.5'
gem 'sidekiq-cron', '1.1.0'
gem 'sidekiq-unique-jobs', '6.0.15'

@hiepdinhxxx
Copy link

I have the same issue :( I was bypass this issue by option on_conflict: :replace

sidekiq_options queue: 'client_financial_info_worker', lock: :until_executing, on_conflict: :replace

@mhenrixon
Copy link
Owner

@hiepdinhxxx are you also using sidekiq-cron?

@mhenrixon
Copy link
Owner

@danilvoe I'm not sure if you managed to get past the problem, I'd be interested in learning more about that setup. I've come across some situations with other sidekiq plugins/middleware causing problems for me.

@danilvoe
Copy link
Author

@hiepdinhxxx

The worker is now defined:

    include Sidekiq::Worker
    sidekiq_options lock: :until_executed, queue: :internal_manager, retry: false, backtrace: true, unique_args: :unique_args

    def self.unique_args(args)
      [ args[0]["id_proc"] ]
    end

As far as I remember, after determining the method of checking for uniqueness, the problem disappeared.

@mhenrixon
Copy link
Owner

Closing as the problem seems to have resolved itself. Please see #571 for upgrading to v7.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants