4

我使用 resque-history 插件来监控已完成的任务。

首先,我将此字符串require 'resque-history/server'包含到路由文件中,然后我在仪表板中看到新的历史记录选项卡。

这是/app/jobs/welcome_email_job.rb中的一些代码

require 'resque-history'

class WelcomeEmailJob < ActiveJob::Base
  extend Resque::Plugins::History
  @max_history = 200
  @queue = :email

  def perform(user)
   UserMailer.welcome_email(user).deliver_now
    puts "I delivered mail to #{user.login} now, sincerly yours Resque <3"
  end
end

工作完成后,我在统计选项卡中看到处理了多少工作,但历史选项卡为空,只有表头。我能解决这个问题吗?

4

1 回答 1

0

尝试重新启动您的工作人员(它们不会自动重新启动)。

于 2016-07-05T20:25:56.310 回答