Skip to content

Commit

Permalink
Update README to mention second-precision jobs
Browse files Browse the repository at this point in the history
Lack of support for this keeps getting raised as an issue on GitHub,
despite the fact it is in fact supported:

  #103
  #67
  #26
  • Loading branch information
tekin committed Jan 4, 2022
1 parent 6a0aeff commit 3e417b4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,25 @@ like this `'0 22 * * 1-5 America/Chicago'`.

See [rufus-scheduler documentation](https://github.com/jmettraux/rufus-scheduler#a-note-about-timezones) for more information. (note. Rufus scheduler is using Fugit under the hood, so documentation for Rufus Scheduler can help you also)


#### Second-precision cronlines

In addition to the standard 5-parameter cronline format, sidekiq-cron supports scheduling jobs with second-precision using a modified 6-parameter cronline format:

`Seconds Minutes Hours Days Months DayOfWeek`

For example: `"*/30 * * * * *"` would schedule a job to run every 30 seconds.

Note that if you plan to schedule jobs with very low second intervals then you may need to adjust the Sidekiq default poll interval so it is lower than the interval of your jobs:

```ruby
Sidekiq.configure_server do |config|
config.average_scheduled_poll_interval = 2
end
```

The default value at time of writing is 5.

### What objects/classes can be scheduled
#### Sidekiq Worker
In this example, we are using `HardWorker` which looks like:
Expand Down

0 comments on commit 3e417b4

Please sign in to comment.