Skip to content

Commit

Permalink
Try and pull from average_scheduled_poll_interval
Browse files Browse the repository at this point in the history
  • Loading branch information
merrington committed Mar 2, 2021
1 parent 7ca90f9 commit 381081c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions Changes.md
Expand Up @@ -2,6 +2,7 @@ v 1.3.0 (in progress)
-------

- add confirmation dialog when enquing jobs from UI
- Start to support Sidekiq `average_scheduled_poll_interval` option (replaced `poll_interval`)

v 1.2.0
-------
Expand Down
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -296,6 +296,10 @@ Sidekiq-Cron adds itself into this start procedure and starts another thread wit

Sidekiq-Cron is checking jobs to be enqueued every 30s by default, you can change it by setting:
```
# For Sidekiq >= 3.4
Sidekiq.options[:average_scheduled_poll_interval] = 10
# For older versions of Sidekiq
Sidekiq.options[:poll_interval] = 10
```

Expand Down
2 changes: 1 addition & 1 deletion lib/sidekiq/cron/poller.rb
Expand Up @@ -34,7 +34,7 @@ def enqueue_job(job, time = Time.now.utc)
end

def poll_interval_average
Sidekiq.options[:poll_interval] || POLL_INTERVAL
Sidekiq.options[:average_scheduled_poll_interval] || Sidekiq.options[:poll_interval] || POLL_INTERVAL
end
end
end
Expand Down

0 comments on commit 381081c

Please sign in to comment.