2017-08-27 17 views
0

私はRuby on Railsアプリケーションで作業しています。私はsidekiqを使用しているので、バックグラウンドプロセスが必要です。 1つの仕事細かい作業コードの上SidekiqでRuby on Railsの複数のワーカー

#app/config/sidekiq.yml 
:schedule: 
    send_news: 
     cron: "0 20 * * * America/Los_Angeles" 
     class: SendNews 

の場合:このコードは以下の

例。問題は、複数の作業者を試すときのコードの下にあります。

#app/config/sidekiq.yml 
:schedule: 
    send_news: 
     cron: "0 20 * * * America/Los_Angeles" 
     class: SendNews 

:schedule: 
    send_notification: 
     cron: "0 21 * * * America/Los_Angeles" 
     class: SendNotification 

:schedule: 
    send_summery: 
     cron: "0 22 * * * America/Los_Angeles" 
     class: SendSummery 

これは実行されていませんが、私は間違っているのか分かりません。

以下、このようなすべてのクラスを見て:それはシングルだ時に細かい作業クラス&方法で

class SendNews 
    include Sidekiq::Worker 

    def perform 
    load File.join(Rails.root, 'lib', 'task_helpers', 'news_helper.rb') 
    NewsHelper.today_news 
    end 
end 

ありがとうございました

答えて

1

これは試しましたか?

#app/config/sidekiq.yml 
:schedule: 
    send_news: 
    cron: "0 20 * * * America/Los_Angeles" 
    class: SendNews 
    send_notification: 
    cron: "0 21 * * * America/Los_Angeles" 
    class: SendNotification 
    send_summery: 
    cron: "0 22 * * * America/Los_Angeles" 
    class: SendSummery 
関連する問題