我有一個非常簡單的類使用Delayed::Job 2.1.4
一個問題,那就是:不能得到延遲::工作與一個非常簡單的類工作
class C2dmJob < Struct.new(:msg)
def perform
# doing something
end
end
在我把這個類在lib
開始時目錄,但將其移至模型目錄以進行測試。運行時間:Delayed::Job.enqueue C2dmJob.new('foo')
我得到存儲在Delayed::Job
表中輸入以下內容:
0, handler: "--- !ruby/struct:C2dmJob \nmsg: foo\n", last_error: nil, run_at: "2011-07-21 10:56:58", locked_at: nil, failed_at: nil, locked_by: nil, created_at: "2011-07-21 10:56:58", updated_at: "2011-07-21 10:56:58">
和作業失敗,出現以下錯誤信息:
[Worker(host:xxx pid:2660)] C2dmJob failed with NoMethodError: You have a nil object when you didn't expect it! You might have expected an instance of Array. The error occurred while evaluating nil.each - 1 failed attempts
你覺得有什麼不對?我懷疑與序列化有關的東西,但我不知道究竟是什麼!
謝謝!
,你可以提供你的工作代碼清單? – Anatoly
與堆棧跟蹤請 – Anatoly
什麼是作業文件名? – Anatoly