I am working with resque and rufus scheduler.
I have created two different queues for the two different resque jobs and able to execute both the queues.
But I am facing one issue as both the queues are executing twice every time.
Here is the Scheduler.rb file :
Directory : config/initializers/scheduler.rb
require 'rubygems'
require 'rufus/scheduler'
scheduler = Rufus::Scheduler.new
scheduler.cron '46 19 * * *' do
Resque::Job.create(:monitoring_queue, Monitoring)
end
scheduler.every '60m' do
Resque::Job.create(:execute_monitoring_queue, ExecuteMonitor)
end
Here is the resque job file-1 monitoring.rb
class Monitoring
@queue = :monitoring_queue
def self.perform()
begin
Monitor.check_and_confirm
NotificationMailer.notification_email.deliver
rescue Exception => e
puts e.message
e.backtrace.join("\n")
end
end
end
Here is the resque job file-2 execute_monitor.rb
class ExecuteMonitor
@queue = :execute_monitoring_queue
def self.perform()
begin
Monitor.confirm_and_check
NotificationMailer.notification_email.deliver
rescue Exception => e
puts e.message
e.backtrace.join("\n")
end
end
end
can any please tell me why those queues are executing twice every time or is there something that I am missing.
Just let me know anything needed.