鲁弗斯cron作业不是在阿帕奇/客运工作 [英] rufus cron job not working in Apache/Passenger
问题描述
我有阿帕奇/乘客运行Rails应用程序。它在后台运行,并通过电子邮件发送通知的鲁弗斯 - 调度cron作业。
I have a Rails app running on Apache/Passenger. It has a rufus-scheduler cron job that runs in the background and sends out notifications via email.
当我运行在WEBrick服务器上开发应用程序,就像他们应该要发送的电子邮件被发送。
When I am running the app in development on the WEBrick server, the emails are sent like they are supposed to be sent.
当我开始了在生产环节上的Apache /乘客的应用程序,这些电子邮件不会被发送。在生产日志不显示鲁弗斯的调度程序的任何日志。
When I start up the app in production on Apache/Passenger, the emails don't get sent. In the production logs it doesn't show any logs for rufus-scheduler.
我被困在了这个问题。您的帮助将是AP preciated,提前谢谢你。
I'm stuck in this problem. Your help will be appreciated, thank you in advance.
推荐答案
最简单的办法是设置 PassengerSpawnMethod
到直接
。该乘客的Phusion文档解释了为什么这解决了它:的http://www.modrails.com/documentation/Users%20guide%20Apache.html#spawning_methods_explained
特别是,看看节15.4智能产卵的疑难杂症#2:需要恢复线程。
The easiest solution is to set PassengerSpawnMethod
to direct
. The Phusion Passenger documentation explains why this solves it: http://www.modrails.com/documentation/Users%20guide%20Apache.html#spawning_methods_explained
In particular, take a look at section "15.4. Smart spawning gotcha #2: the need to revive threads".
这篇关于鲁弗斯cron作业不是在阿帕奇/客运工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!