fix(cron): really schedule jobs on sidekiq instead of running them
This commit is contained in:
parent
e1144cf655
commit
dfbe53dcc5
1 changed files with 3 additions and 3 deletions
|
@ -4,14 +4,14 @@ class Cron::CronJob < ApplicationJob
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def schedulable?
|
def schedulable?
|
||||||
true && ENV['CRON_JOBS_DISABLED'].blank?
|
ENV['CRON_JOBS_DISABLED'].blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
def schedule
|
def schedule
|
||||||
remove if cron_expression_changed?
|
remove if cron_expression_changed?
|
||||||
|
|
||||||
if !scheduled?
|
if !scheduled?
|
||||||
if queue_adapter == :sidekiq
|
if queue_adapter_name == "sidekiq"
|
||||||
Sidekiq::Cron::Job.create(name: name, cron: cron_expression, class: name)
|
Sidekiq::Cron::Job.create(name: name, cron: cron_expression, class: name)
|
||||||
else
|
else
|
||||||
set(cron: cron_expression).perform_later
|
set(cron: cron_expression).perform_later
|
||||||
|
@ -36,7 +36,7 @@ class Cron::CronJob < ApplicationJob
|
||||||
end
|
end
|
||||||
|
|
||||||
def enqueued_cron_job
|
def enqueued_cron_job
|
||||||
if queue_adapter == :sidekiq
|
if queue_adapter_name == "sidekiq"
|
||||||
sidekiq_cron_job
|
sidekiq_cron_job
|
||||||
else
|
else
|
||||||
delayed_job
|
delayed_job
|
||||||
|
|
Loading…
Reference in a new issue