Commit 25c11d91 authored by pierre.tremouilhac's avatar pierre.tremouilhac
Browse files

Merge branch '244-delayedjob-config-error' into 'development'

delayed job init changed conditions on config

Closes #244

See merge request !442
parents 7787878b 30eb8633
......@@ -9,12 +9,13 @@
Delayed::Worker.logger = Logger.new(File.join(Rails.root, 'log', 'delayed_job.log'))
if Rails.env.production? && Delayed::Job.column_names.include?('cron')
if Rails.configuration.datamailcollector
if Rails.configuration.respond_to?(:datamailcollector)
CollectDataFromMailJob.set(cron: '*/15 * * * *').perform_later if Delayed::Job.where("handler like ?", "%CollectDataFromMailJob%").empty?
else
Delayed::Job.where("handler like ?", "%CollectDataFromMailJob%").destroy_all
end
if Rails.configuration.datacollector
if Rails.configuration.respond_to?(:datacollector)
CollectDataFromDevicesJob.set(cron: '*/5 * * * *').perform_later if Delayed::Job.where("handler like ?", "%CollectDataFromDevicesJob%").empty?
else
Delayed::Job.where("handler like ?", "%CollectDataFromDevicesJob%").destroy_all
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment