【问题标题】:rufus cron job not working in Apache/Passengerrufus cron 作业在 Apache/Passenger 中不起作用
【发布时间】:2014-03-18 15:44:42
【问题描述】:

我有一个在 Apache/Passenger 上运行的 Rails 应用程序。它有一个 rufus-scheduler cron 作业,在后台运行并通过电子邮件发送通知。

当我在 WEBrick 服务器上运行开发中的应用程序时,电子邮件会像应该发送的那样发送。

当我在 Apache/Passenger 上启动生产中的应用程序时,没有发送电子邮件。在生产日志中,它不显示 rufus-scheduler 的任何日志。

我陷入了这个问题。您的帮助将不胜感激,在此先感谢您。

【问题讨论】:

标签: ruby-on-rails-3 apache passenger linode rufus-scheduler


【解决方案1】:

最简单的解决方案是将PassengerSpawnMethod 设置为direct。 Phusion 乘客文档解释了为什么可以解决这个问题:http://www.modrails.com/documentation/Users%20guide%20Apache.html#spawning_methods_explained 特别是,请查看“15.4. Smart spawning gotcha #2: the need to revive threads”部分。

【讨论】:

  • 感谢宏利的宝贵回答,但我已经通过使用 cronic gem 解决了我的问题。网址:-github.com/mojombo/chronic
  • 嗨,我必须设置PassengerSpawnMethod属性,我在Ubuntu环境中使用独立安装Passenger 5。
  • "passenger start --spawn-method direct" 你能帮忙解决这个问题吗
  • 这个链接对我理解繁殖方法有很大帮助:phusionpassenger.com/library/indepth/ruby/spawn_methods
猜你喜欢
  • 1970-01-01
  • 2015-02-23
  • 2016-07-21
  • 1970-01-01
  • 1970-01-01
  • 2013-05-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多