私はちょうど私のレールアプリでAWS Elastic Beanstalkを使い始めました。バックグラウンドジョブ用にResque gemを使う必要があります。しかし、Elastic BeanstalkでResqueワーカーを実行する方法を検索するためのすべての努力にもかかわらず、私はどのように把握することができませんでしたか?AWS Elastic BeanstalkでRailsのバックグラウンドジョブを実行するにはどうすればよいですか?
How can I run Rails background jobs with Resque on AWS Elastic Beanstalk? Elastic Beanstalkのコンテナでそれらをサービスとして実行することについてはお話ししていますが、依然として非常に混乱しています。
ここに私のebextentions resque.configファイル:
services:
sysvinit:
resque_worker:
enabled: true
ensureRunning: true
commands:
resque_starter:
rake resque:work QUEUE='*'
EDIT は今私のresque.configファイルは次のようになります。
container_commands:
resque_starter: "rake resque:work QUEUE='*'"
services:
sysvinit:
resque_worker:
enabled: true
ensureRunning: true
commands:
resque_starter
そして、それはまだ動作していません。 EDIT 2
container_commands:
resque_starter:
command: "rake resque:work QUEUE=sqs_message_sender_queue"
cwd: /var/app/current/
ignoreErrors: true
まだそれが0労働者を示しています。
あなたを混乱させる原因は何ですか? –
コマンドの代わりにcontainer_commandsを使用することをお勧めします。 –
私が混乱しているのは、すべてのデプロイメントの後に自動的に "rake resque:work QUEUE = '*'"コマンドを実行して、強制終了して再実行する方法です。私はそれがより具体的であることを願っています –