我最近安装了delayed_job_active_record并完成了heroku的典型安装步骤,出于某种原因,当我在本地运行时(我和我的团队中的另一个开发人员)不断收到错误,我们的Web进程在尝试更新locked_at时会锁定。
15:22:35 web.1 | started with pid 672
15:22:35 worker.1 | started with pid 673
...
15:23:23 web.1 | Delayed::Backend::ActiveRecord::Job Load (1.0ms) UPDATE "delayed_jobs" SET locked_at = '2013-05-28 22:22:48.419281', locked_by = 'host:Jons-MacBook-Pro.local pid:673' WHERE id IN (SELECT id FROM "delayed_jobs" WHERE ((run_at <= '2013-05-28 22:22:48.418576' AND (locked_at IS NULL OR locked_at < '2013-05-28 18:22:48.418615') OR locked_by = 'host:Jons-MacBook-Pro.local pid:673') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *
引用的PID是工作者PID,但是我有一个新的db(做db:drop db:create db:migrate to test)并且没有延迟的作业,所以没有理由让delayed_job被锁定任何东西。
那么..有没有人建议我应该在哪里开始调试这样的东西?我似乎无法找到它的来源,并希望在找出去哪里时能有所帮助。