我在带有 MySQL DB 的 Rails 3.2.14 上运行延迟作业 3.0.5 和延迟作业活动记录 0.4.4 和守护进程 1.1.9。当我执行 script/delayed_job start 命令时,它似乎正常启动但没有创建 pid 文件。当我检查delayed_job 日志时,没有错误只是进程正在启动的信息性消息。
但是,当我查看 rails 开发日志时,我看到 SQL 更新命令后返回一个未知别名。这是我日志中的一个片段,显示了我在哪里开始延迟_job 两次。每次它得到一个新的 pid 并且每次它都给出相同的 Unknown 别名。
在尝试解决此问题时,我将不胜感激。
bcrossland-mb:GameKultur bcrossland$ tail log/development.log
Delayed::Backend::ActiveRecord::Job Load (17.9ms) SELECT `delayed_jobs`.* FROM `delayed_jobs` WHERE `delayed_jobs`.`locked_at` = '2013-09-18 21:14:09' AND `delayed_jobs`.`locked_by` = 'delayed_job host:bcrossland-mb.local pid:13163' AND `delayed_jobs`.`failed_at` IS NULL LIMIT 1
Preference Load (0.5ms) SELECT `preferences`.* FROM `preferences` LIMIT 1
SQL (8.0ms) UPDATE `delayed_jobs` SET `locked_by` = NULL, `locked_at` = NULL WHERE `delayed_jobs`.`locked_by` = 'delayed_job host:bcrossland-mb.local pid:13163'
Unknown alias: 70352758094800
Connecting to database specified by database.yml
SQL (105.9ms) UPDATE `delayed_jobs` SET `locked_at` = '2013-09-18 21:36:58', `locked_by` = 'delayed_job host:bcrossland-mb.local pid:13564' WHERE ((run_at <= '2013-09-18 21:36:58' AND (locked_at IS NULL OR locked_at < '2013-09-18 17:36:58') OR locked_by = 'delayed_job host:bcrossland-mb.local pid:13564') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1
Delayed::Backend::ActiveRecord::Job Load (1.1ms) SELECT `delayed_jobs`.* FROM `delayed_jobs` WHERE `delayed_jobs`.`locked_at` = '2013-09-18 21:36:58' AND `delayed_jobs`.`locked_by` = 'delayed_job host:bcrossland-mb.local pid:13564' LIMIT 1
Preference Load (0.6ms) SELECT `preferences`.* FROM `preferences` LIMIT 1
SQL (1.8ms) UPDATE `delayed_jobs` SET `locked_by` = NULL, `locked_at` = NULL WHERE `delayed_jobs`.`locked_by` = 'delayed_job host:bcrossland-mb.local pid:13564'
Unknown alias: 70352758094800