From b405ca807344126c7ff2500bae8702d696a92854 Mon Sep 17 00:00:00 2001 From: elasticspoon Date: Sun, 18 May 2025 16:29:51 -0400 Subject: [PATCH] feat: add recurring cleanup job to generator Its not immediately clear that finished jobs need to be cleaned up or that solid queue has a built in way to do that. This adds a commented out implementation of that recurring behavior to the generator to make is easier for users to learn about the behavior. --- .../solid_queue/install/templates/config/recurring.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/generators/solid_queue/install/templates/config/recurring.yml b/lib/generators/solid_queue/install/templates/config/recurring.yml index d045b191..2c668cb0 100644 --- a/lib/generators/solid_queue/install/templates/config/recurring.yml +++ b/lib/generators/solid_queue/install/templates/config/recurring.yml @@ -8,3 +8,10 @@ # command: "SoftDeletedRecord.due.delete_all" # priority: 2 # schedule: at 5am every day +# +# Right now, there's no automatic cleanup of finished jobs. +# This reccuring job will clean up jobs older than the +# `clear_finished_jobs_after` period which defaults to 1 day. +# finished_job_cleanup: +# command: "SolidQueue::Job.clear_finished_in_batches" +# schedule: at 2am every day