From 59c3300bde2b64bfc135e7f37fb93a59db7db899 Mon Sep 17 00:00:00 2001 From: "Ben Sheldon [he/him]" Date: Mon, 12 Aug 2024 16:59:34 -0700 Subject: [PATCH] Update cron documentation to remove confusion about multiple processes (#1467) --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index e1e493bc..65f87a9b 100644 --- a/README.md +++ b/README.md @@ -613,9 +613,7 @@ GoodJob's concurrency control strategy for `perform_limit` is "optimistic retry GoodJob can enqueue Active Job jobs on a recurring basis that can be used as a replacement for cron. -Cron-style jobs can be performed by any GoodJob process (e.g., CLI or `:async` execution mode) that has `config.good_job.enable_cron` set to `true`. That is, one or more job executor processes can be configured to perform recurring jobs. - -GoodJob's cron uses unique indexes to ensure that only a single job is enqueued at the given time interval. In order for this to work, GoodJob must preserve cron-created job records; these records will be automatically deleted like any other preserved record. +Cron-style jobs can be enequeued by any GoodJob process (e.g., CLI or `:async` execution mode) that has `config.good_job.enable_cron` set to `true`. Enabling cron on multiple processes will not enqueue duplicate jobs; GoodJob's cron uses unique indexes to ensure that only a single job is enqueued for a given time interval. In order for this to work, GoodJob must preserve cron-created job records; these records will be automatically deleted like any other preserved record. Cron-format is parsed by the [`fugit`](https://github.com/floraison/fugit) gem, which has support for seconds-level resolution (e.g. `* * * * * *`) and natural language parsing (e.g. `every second`). @@ -624,8 +622,8 @@ If you use the [Dashboard](#dashboard) the scheduled tasks can be viewed in the ```ruby # config/environments/application.rb or a specific environment e.g. production.rb -# Enable cron in this process, e.g., only run on the first Heroku worker process -config.good_job.enable_cron = ENV['DYNO'] == 'worker.1' # or `true` or via $GOOD_JOB_ENABLE_CRON +# Enable cron enqueuing in this process +config.good_job.enable_cron = true # Configure cron with a hash that has a unique key for each recurring job config.good_job.cron = {