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

Prevent enqueueing of duplicated cron and at job instances #104

Merged
merged 1 commit into from
Apr 22, 2016

Conversation

snmgian
Copy link
Contributor

@snmgian snmgian commented Apr 18, 2016

Ignore job enqueueing if it has already been enqueued for the same timestamp.

This solves the problem when multiple sidekiq instances having cron jobs are running.

Issue: #88

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 95.621% when pulling 4e72156 on snmgian:issues/88 into 4cd22fd on moove-it:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 95.621% when pulling ae1b53d on snmgian:issues/88 into 4cd22fd on moove-it:master.

@snmgian snmgian changed the title Prevent enqueueing of duplicated job instances Prevent enqueueing of duplicated cron and interval job instances Apr 21, 2016
@snmgian snmgian changed the title Prevent enqueueing of duplicated cron and interval job instances Prevent enqueueing of duplicated cron and at job instances Apr 21, 2016
@@ -102,16 +104,19 @@ def self.load_schedule_job(name, config)
interval_defined = false
interval_types = %w{cron every at in}
interval_types.each do |interval_type|
if !config[interval_type].nil? && config[interval_type].length > 0
args = self.optionizate_interval_value(config[interval_type])
config_interval_type = config[interval_type] #config.delete(interval_type)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the comment that doesn't make sence

@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 95.658% when pulling 9b6401b on snmgian:issues/88 into 2821d61 on moove-it:master.

@elpic
Copy link
Contributor

elpic commented Apr 21, 2016

You can :shipit:

@snmgian snmgian merged commit ee317fd into sidekiq-scheduler:master Apr 22, 2016
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

Successfully merging this pull request may close these issues.

None yet

3 participants