From 016c3929142c21c09dc246b094c0c756a9d90590 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Thu, 14 Dec 2023 17:12:19 +0100 Subject: [PATCH] tech: add env var to disable cron scheduling --- app/jobs/cron/cron_job.rb | 2 +- config/env.example.optional | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/jobs/cron/cron_job.rb b/app/jobs/cron/cron_job.rb index 902e8f106..16d5c1a73 100644 --- a/app/jobs/cron/cron_job.rb +++ b/app/jobs/cron/cron_job.rb @@ -4,7 +4,7 @@ class Cron::CronJob < ApplicationJob class << self def schedulable? - true + true && ENV['CRON_JOBS_DISABLED'].blank? end def schedule diff --git a/config/env.example.optional b/config/env.example.optional index 7a08daaab..c3c7bac7c 100644 --- a/config/env.example.optional +++ b/config/env.example.optional @@ -259,3 +259,6 @@ WEASYPRINT_URL="http://10.33.23.204:5000/pdf" # Use this env var customize the max number of deleted user per day EXPIRE_USER_DELETION_JOB_LIMIT=10000 + +# write anything to disable cron jobs +CRON_JOBS_DISABLED=""