4

我正在使用 resque-scheduler 根据用户的输入来安排动态 crons。我的服务器堆栈使用带有乘客 + nginx 配置的 Ubuntu 12.04。

我设置了Resque::Scheduler.dynamic = true 并使用set_schedule 方法和 persist: true选项来安排动态作业

起初的问题是它给了我一些乘客错误:-

Redis::InheritedError (Tried to use a connection from a child process without reconnecting. You need to reconnect to Redis after forking.

所以我在我的 resque 初始化程序中引入了以下块:-

PhusionPassenger.on_event(:starting_worker_process) do |forked|
  if forked
    # Reconnect Resque Redis instance.
    Resque.redis.client.reconnect
  end
end

现在,在每次重新启动或安排新的动态作业后,它会加载我的静态计划,而动态计划正在丢失。即使它正在更新随机时间的时间表并仅加载静态时间表。

4

1 回答 1

0

加载动态时间表的问题存在于 gem 版本中。请参阅 github 上最新的 resque 调度程序版本,这应该可以解决问题(大约 10 天前修复)。

于 2013-12-24T13:03:38.307 回答