From dfbe53dcc5fe3f290b79e20c4f537e7797908011 Mon Sep 17 00:00:00 2001 From: Colin Darie Date: Wed, 10 Apr 2024 18:02:17 +0200 Subject: [PATCH] fix(cron): really schedule jobs on sidekiq instead of running them --- app/jobs/cron/cron_job.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/jobs/cron/cron_job.rb b/app/jobs/cron/cron_job.rb index e7f4c66e1..10a3f4524 100644 --- a/app/jobs/cron/cron_job.rb +++ b/app/jobs/cron/cron_job.rb @@ -4,14 +4,14 @@ class Cron::CronJob < ApplicationJob class << self def schedulable? - true && ENV['CRON_JOBS_DISABLED'].blank? + ENV['CRON_JOBS_DISABLED'].blank? end def schedule remove if cron_expression_changed? if !scheduled? - if queue_adapter == :sidekiq + if queue_adapter_name == "sidekiq" Sidekiq::Cron::Job.create(name: name, cron: cron_expression, class: name) else set(cron: cron_expression).perform_later @@ -36,7 +36,7 @@ class Cron::CronJob < ApplicationJob end def enqueued_cron_job - if queue_adapter == :sidekiq + if queue_adapter_name == "sidekiq" sidekiq_cron_job else delayed_job