我通过以下代码将 csv 文件传递给延迟作业。
csv_text = IO.read(params[:emails_import].tempfile.to_path, :encoding => 'UTF-8').gsub(" ", "")
csv_text = csv_text.gsub("\n\n", "\n")
Delayed::Job.enqueue ImportContact.new(@list.id, csv_text), :queue => "import-list-#{@list.id}"
我通过工头收到以下错误消息。知道什么可能导致这个问题吗?我认为错误可能在 csv 文件中,但我不确定是哪里/是什么导致了问题。
[Worker(host:ubuntu pid:22678)] Starting job worker
16:50:22 worker.1 | SQL (129.4ms) UPDATE `delayed_jobs` SET locked_at = '2013-04-16 20:50:22', locked_by = 'host:ubuntu pid:22678' WHERE (id = 121 and (locked_at is null or locked_at < '2013-04-16 16:50:22') and (run_at <= '2013-04-16 20:50:22'))
16:50:22 worker.1 | SQL (96.4ms) UPDATE `delayed_jobs` SET locked_by = null, locked_at = null WHERE (locked_by = 'host:ubuntu pid:22678')
16:50:22 worker.1 | rake aborted!
16:50:22 worker.1 | couldn't parse YAML at line 6709 column 4
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/backend/base.rb:84:in `payload_object'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/backend/base.rb:71:in `name'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:230:in `handle_failed_job'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:191:in `block in run'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:60:in `call'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:60:in `block in initialize'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:65:in `call'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:65:in `execute'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:38:in `run_callbacks'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:191:in `rescue in run'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:181:in `run'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:238:in `block in reserve_and_run_one_job'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:60:in `call'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:60:in `block in initialize'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:65:in `call'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:65:in `execute'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:38:in `run_callbacks'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:238:in `reserve_and_run_one_job'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:166:in `block in work_off'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:165:in `times'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:165:in `work_off'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:133:in `block (4 levels) in start'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:132:in `block (3 levels) in start'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:60:in `call'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:60:in `block in initialize'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:65:in `call'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:65:in `execute'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:38:in `run_callbacks'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:129:in `block (2 levels) in start'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:128:in `loop'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:128:in `block in start'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/plugins/clear_locks.rb:7:in `call'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/plugins/clear_locks.rb:7:in `block (2 levels) in <class:ClearLocks>'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:78:in `call'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:78:in `block (2 levels) in add'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:60:in `call'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:60:in `block in initialize'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:78:in `call'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:78:in `block in add'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:65:in `call'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:65:in `execute'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/lifecycle.rb:38:in `run_callbacks'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/worker.rb:127:in `start'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/gems/delayed_job-3.0.3/lib/delayed/tasks.rb:9:in `block (2 levels) in <top (required)>'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/bin/ruby_noexec_wrapper:14:in `eval'
16:50:22 worker.1 | /home/cory/.rvm/gems/ruby-1.9.2-p320@postpourri/bin/ruby_noexec_wrapper:14:in `<main>'
16:50:22 worker.1 | Tasks: TOP => jobs:work
16:50:22 worker.1 | (See full trace by running task with --trace)
16:50:22 worker.1 | exited with code 1
16:50:22 system | sending SIGTERM to all processes
SIGTERM received