Commit 30eb8633 authored by PiTrem's avatar PiTrem
Browse files

delayed job init changed conditions on config

parent ee3e5b5f
......@@ -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