Resque远程作业

时间:2013-03-08 13:51:05

标签: ruby-on-rails redis resque

所以我有两台服务器。

服务器A:有redis,ruby + resque gem + rake gem 服务器B:在rails + resque gem上有ruby

从服务器B我在服务器A上将作业排队到Redis。服务器A接收作业:

*** Found job on test
*** got: (Job{test} | TestQueue | [])
*** Running before_fork hooks with [(Job{test} | TestQueue | [])]
*** resque-1.23.1: Forked 10388 at 1362750385
*** Failed to start worker : #<NameError: uninitialized constant TestQueue>

所以我认为这些工作需要在服务器A上运行。所以我把工作转移到那里。但是,当我从服务器B入队时,我得到以下内容:

rails console
Loading development environment (Rails 3.2.12)
irb(main):001:0>  Resque.enqueue(TestQueue)
NameError: uninitialized constant TestQueue

我唯一能让它发挥作用的方式就是我在两台服务器上都有这份工作,但那远非理想。

如何远程绕过排队作业?

1 个答案:

答案 0 :(得分:0)

resque-remote是用于远程排队作业的宝石。

如果Resque.inline为真,则作业将排入当前队列。

来源:https://github.com/localshred/resque-remote

相关问题