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

while_executing still runs duplicate tasks #136

Closed
Mehonoshin opened this issue Oct 21, 2015 · 5 comments
Closed

while_executing still runs duplicate tasks #136

Mehonoshin opened this issue Oct 21, 2015 · 5 comments

Comments

@Mehonoshin
Copy link

Hi, folks!

Probably I'm doing something wrong, hope you'll help me.

I have following worker:

module ScheduledJobs
  class BaseWorker
    include Sidekiq::Worker

    sidekiq_options queue:  :scheduler,
                    unique: :while_executing,
                    log_duplicate_payload: true

    def perform
      fail 'Implement in child class'
    end
  end
end

It runs some periodic tasks, without any args.
And I don't want this tasks to be run simultaneously.

But if I start this job multiple times - all tasks will be running.

If I change :while_executing to :until_executed - then this task is run only once, and after its completion new tasks will not be processed.

Where is my mistake?

@mhenrixon
Copy link
Owner

mhenrixon commented Oct 21, 2015 via email

@Mehonoshin
Copy link
Author

So it's normal, that I can see then under 'busy' tab in sidekiq dashboard?

@Mehonoshin
Copy link
Author

Ok, lets move to the second issue.
Why a processed task is not starting again with :until_executed?

@mhenrixon
Copy link
Owner

I have absolutely no idea why your jobs aren't continuously processed after being executed. The lock gets cleared as the job is processed. Not heard about that problem before. Not sure what sidekiq queue is but if it is scheduler then that might be the problem.

@Mehonoshin
Copy link
Author

BTW, I'm creating jobs via clockwork gem, without loading rails environment

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

No branches or pull requests

2 participants