简体   繁体   English

如何在Amazon EC2 ubuntu服务器上激活延迟的作业?

[英]How to activate delayed jobs on Amazon EC2 ubuntu server?

On Heroku, I just install an addon and it's all. 在Heroku上,我只安装了一个插件就可以了。 On localhost, I have installed a deamon gem, delayed jobs gems and that was done. 在localhost上,我安装了一个deamon gem, delayed jobsdeamon gems,然后完成了。 I ran an action as 我以

Notifier.delay.signup(@user)

and the record was added to delayed_jobs table. 并将该记录添加到delayed_jobs表中。 Then I ran rake:jobs:work and all records in delayed_jobs table were processed. 然后我运行了rake:jobs:work ,并处理了delayed_jobs表中的所有记录。

But on EC2, the records are added to database, but there are not processed -- how to automatically process them? 但是在EC2上,记录被添加到数据库中,但是没有被处理-如何自动处理它们?

EDIT: I've installed these gems: 编辑:我已经安装了这些宝石:

gem 'delayed_job_active_record'
gem "daemons", "~> 1.1.9"

See https://github.com/collectiveidea/delayed_job#running-jobs 参见https://github.com/collectiveidea/delayed_job#running-jobs

RAILS_ENV=production script/delayed_job start

Or 'bin/delayed_job' in rails 4 或在导轨4中的“ bin / delayed_job”

This will fire up 1 delayed job process, note that you can and may want to run this on another EC2 box if running rails and delayed job on the same box is too resource intensive 这将启动1个延迟的作业过程,请注意,如果在同一盒上运行rails和延迟的作业过于占用资源,则可以并且可能希望在另一个EC2盒上运行它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM