mercredi 17 juin 2015

resque-scheduler rake task resque:work does not follow scheduler setup

I have a job that need to run every 30s. I used resque-scheduler gem to configure my job as

config/resques.yml do_billing_street: cron: "30 * * * *" class: BillingStreet args: description: Runs the perform method in BillingStreet

app/jobs/billing_street.rb file

module BillingStreet

  @queue = :billing_street_queue

  def self.perform()

   p "BillingStreet: starting service..................."
  end
end

initializers/resque.rb

Dir["#{Rails.root}/app/jobs/*.rb"].each { |file| require file }

Resque.schedule = YAML.load_file(Rails.root.join('config', 'resque_schedule.yml'))

after i started server, i run two rake tasks

rake resque:scheduler
rake resque:work

but my job have seen working EVERY SECOND. i need the job works every 30s

Aucun commentaire:

Enregistrer un commentaire