且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在生产模式下使用acts_as_ferret的DelayedJob

更新时间:2023-11-19 18:18:52

这也发生在我身上.您需要在运行延迟的作业期间禁止雪貂索引.

This happened to me too. You need to disable ferret from indexing during the running of the delayed job.

在您的工作程序定义中(类似RAILS_ROOT/lib/worker.rb),并给一个名为Post的模型,您应该包括这样的一行:

In your worker definition (something like RAILS_ROOT/lib/worker.rb), and given a model called Post, you should include a line like this:

class Worker < Struct.new(:stuff)
  def perform
    Post.disable_ferret
    <do some stuff>
    .
    .
    .
  end
end