Solid Queue stores completed jobs in the `solid_queue_jobs` table by default. This GitHub issue explains why.
Solid Queue provides a command to clean up the older records to prevent the database size from growing indefinitely.
Steps
-
Define the retention period in the environment config. (Default is 1 day)
config.solid_queue.clear_finished_jobs_after = 1.month -
Invoke the cleanup command.
> SolidQueue::Job.clear_finished_in_batches -
Alternatively, it can be scheduled as a recurring task in Solid Queue.
# recurring.yml production: periodic_job_cleanup: command: "SolidQueue::Job.clear_finished_in_batches" queue: default schedule: at 4pm every day -
Restart Solid Queue.