2017-04-14 2 views
0

をキューへない:Resque scheduelerローディングジョブが、私はスケジュールを持っており、それがこのようなresque.rakeで定義されている

require 'resque/tasks' 
require 'resque/scheduler/tasks' 
task 'resque:setup' => :environment 



namespace :resque do 
    task :setup do 
    require 'resque' 
    Resque.redis = 'localhost:6379' 


    end 

    task :setup_schedule => :setup do 
    require 'resque-scheduler' 
    ENV['RAILS_ENV'] = Rails.env 
    Resque.schedule = YAML.load_file('config/tweet_schedule.yml') 
    require 'tweet_sender.rb' 
    end 

task :scheduler => :setup_schedule 


end 

schedeleを

tweet_sender: 
    cron: "57 7 * * *" 
    class: "TweetSender" 
    queue: tweets_queue 
    args: tweet_id 
    rails_env: development 
    description: "This job sends daily tweets from the content db" 

tweet_schedule.yml私は実行するたびに(とRedisのサーバーは、レールSは、

bundle exec rake resque:work QUEUE='*' --trace 

を通じて労働者を読み込みます

バンドルのexecすくい環境resque:スケジューラは、私は(私がこれまで名前空間の警告を無視している)私はそれが私のschedusucesfullyleをロードしていると仮定しますが、それはenqued取得されていないように見える次の出力

resque-scheduler: [INFO] 2017-04-14T09:14:49+02:00: Starting 
resque-scheduler: [INFO] 2017-04-14T09:14:49+02:00: Loading Schedule 
resque-scheduler: [INFO] 2017-04-14T09:14:49+02:00: Scheduling tweet_sender 
resque-scheduler: [INFO] 2017-04-14T09:14:49+02:00: Schedules Loaded 
Passing 'info' command to redis as is; administrative commands cannot be effectively namespaced and should be called on the redis connection directly; passthrough has been deprecated and will be removed in redis-namespace 2.0 (at sucesfully/home/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/resque-1.27.2/lib/resque/data_store.rb:60:in `method_missing') 
Passing 'script' command to redis as is; administrative commands cannot be effectively namespaced and should be called on the redis connection directly; passthrough has been deprecated and will be removed in redis-namespace 2.0 (at /home/jan/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/resque-1.27.2/lib/resque/data_store.rb:60:in `method_missing') 

を得る

スケジュールはresque-scheduler web uiに表示され、手動でWebインターフェイスボタンを使用してジョブを正常に実行すると設定されます。それが正しくロードされない理由は何ですか?

Queue now button used to set of jobs

+0

これらのメッセージが表示されたら「Enter」を押してください – Ievgen

答えて

0

だから周りにしようと多くの後、最後に私はresqueスケジューラは私のcronの定義を拾っていなかったことがわかりました。 6 * cronの

5* cron cron: "57 7 * * *" 
5* cron cron: "15 57 7 * * *" 

今時間ごとにスケジュールしますジョブに5 * cronのを変更した後

。標準のcron構文がうまくいかないので、私はまだ仕事をスケジューリングする方法を見つけていません。

minute (0-59), 
|  hour (0-23), 
|  |  day of the month (1-31), 
|  |  |  month of the year (1-12), 
|  |  |  |  day of the week (0-6 with 0=Sunday). 
|  |  |  |  |  command 
0  2  *  *  0,4 
関連する問題