From 254318d128ac5ff5983639cc4f6a437e9c92fbb8 Mon Sep 17 00:00:00 2001 From: Kevin Sylvestre Date: Thu, 17 Oct 2024 18:14:25 -0700 Subject: [PATCH 1/4] Bump local ruby from v3.3.1 to v3.3.5 --- .ruby-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ruby-version b/.ruby-version index bea438e9..fa7adc7a 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.1 +3.3.5 From b001117aaf20b62193df1f65a6e245fa1bdbefa7 Mon Sep 17 00:00:00 2001 From: Kevin Sylvestre Date: Thu, 17 Oct 2024 18:18:36 -0700 Subject: [PATCH 2/4] Support for macOS Sequoia (darwin-24) --- Gemfile.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/Gemfile.lock b/Gemfile.lock index 5aeb2b79..c23a2210 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -175,6 +175,7 @@ PLATFORMS arm64-darwin-23 x86_64-darwin-21 x86_64-darwin-23 + x86_64-darwin-24 x86_64-linux DEPENDENCIES From 4c817ffd7b82f7d7449125279f53953c79f7ea68 Mon Sep 17 00:00:00 2001 From: Kevin Sylvestre Date: Thu, 17 Oct 2024 18:28:24 -0700 Subject: [PATCH 3/4] Change recurring.yml to run cleanup This runs the SolidQueue::Job.clear_finished_in_batches by default. --- .../install/templates/config/recurring.yml | 25 +++++++++++-------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/lib/generators/solid_queue/install/templates/config/recurring.yml b/lib/generators/solid_queue/install/templates/config/recurring.yml index d045b191..1ee2ed5c 100644 --- a/lib/generators/solid_queue/install/templates/config/recurring.yml +++ b/lib/generators/solid_queue/install/templates/config/recurring.yml @@ -1,10 +1,15 @@ -# production: -# periodic_cleanup: -# class: CleanSoftDeletedRecordsJob -# queue: background -# args: [ 1000, { batch_size: 500 } ] -# schedule: every hour -# periodic_command: -# command: "SoftDeletedRecord.due.delete_all" -# priority: 2 -# schedule: at 5am every day +production: + solid_queue_cleanup: + command: "SolidQueue::Job.clear_finished_in_batches" + schedule: every hour + + # periodic_cleanup: + # class: CleanSoftDeletedRecordsJob + # queue: background + # args: [ 1000, { batch_size: 500 } ] + # schedule: every hour + + # periodic_command: + # command: "SoftDeletedRecord.due.delete_all" + # priority: 2 + # schedule: at 5am every day From 9f00f7bab9c02a33e99f9da14174548e192f2dfa Mon Sep 17 00:00:00 2001 From: Kevin Sylvestre Date: Thu, 17 Oct 2024 18:32:52 -0700 Subject: [PATCH 4/4] Document running clear_finished_in_batches --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f9a19a0..04c6c293 100644 --- a/README.md +++ b/README.md @@ -233,7 +233,7 @@ There are several settings that control how Solid Queue works that you can set a - `silence_polling`: whether to silence Active Record logs emitted when polling for both workers and dispatchers—defaults to `true`. - `supervisor_pidfile`: path to a pidfile that the supervisor will create when booting to prevent running more than one supervisor in the same host, or in case you want to use it for a health check. It's `nil` by default. - `preserve_finished_jobs`: whether to keep finished jobs in the `solid_queue_jobs` table—defaults to `true`. -- `clear_finished_jobs_after`: period to keep finished jobs around, in case `preserve_finished_jobs` is true—defaults to 1 day. **Note:** Right now, there's no automatic cleanup of finished jobs. You'd need to do this by periodically invoking `SolidQueue::Job.clear_finished_in_batches`, but this will happen automatically in the near future. +- `clear_finished_jobs_after`: period to keep finished jobs around, in case `preserve_finished_jobs` is `true`-defaults to 1 day. Ensure recurring.yml runs the command `SolidQueue::Job.clear_finished_in_batches` at an appropriate cadence (e.g. hourly) to ensure finished jobs are cleared. - `default_concurrency_control_period`: the value to be used as the default for the `duration` parameter in [concurrency controls](#concurrency-controls). It defaults to 3 minutes. ## Errors when enqueuing