2015-06-14 50 views
1

我第一次使用延遲作業,它似乎工作正常。我開始停止生產日誌以解決另一個問題,並發現延遲作業不斷使用調試代碼更新生產日誌。這是正常的,我可以關閉它嗎?Rails 4 +延遲作業 - 不斷將調試代碼寫入生產日誌

[2015-06-14T16:05:35.983383 #24767] DEBUG -- : SQL (0.5ms) UPDATE `delayed_jobs` SET `delayed_jobs`.`locked_at` = '2015-06-14 16:05:35', `delayed_jobs`.`locked_by` = 'delayed_job host:localhost pid:24767' WHERE ((run_at <= '2015-06-14 16:05:35.980823' AND (locked_at IS NULL OR locked_at < '2015-06-14 12:05:35.980900') OR locked_by = 'delayed_job host:localhost pid:24767') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 
D, [2015-06-14T16:05:36.621786 #2864] DEBUG -- : SQL (0.4ms) UPDATE `delayed_jobs` SET `delayed_jobs`.`locked_at` = '2015-06-14 16:05:36', `delayed_jobs`.`locked_by` = 'delayed_job host:localhost pid:2864' WHERE ((run_at <= '2015-06-14 16:05:36.619634' AND (locked_at IS NULL OR locked_at < '2015-06-14 12:05:36.619699') OR locked_by = 'delayed_job host:localhost pid:2864') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 
D, [2015-06-14T16:05:38.803207 #32414] DEBUG -- : SQL (0.5ms) UPDATE `delayed_jobs` SET `delayed_jobs`.`locked_at` = '2015-06-14 16:05:38', `delayed_jobs`.`locked_by` = 'delayed_job host:localhost pid:32414' WHERE ((run_at <= '2015-06-14 16:05:38.801308' AND (locked_at IS NULL OR locked_at < '2015-06-14 12:05:38.801378') OR locked_by = 'delayed_job host:localhost pid:32414') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 
D, [2015-06-14T16:05:40.683621 #13040] DEBUG -- : SQL (0.4ms) UPDATE `delayed_jobs` SET `delayed_jobs`.`locked_at` = '2015-06-14 16:05:40', `delayed_jobs`.`locked_by` = 'delayed_job host:localhost pid:13040' WHERE ((run_at <= '2015-06-14 16:05:40.681734' AND (locked_at IS NULL OR locked_at < '2015-06-14 12:05:40.681791') OR locked_by = 'delayed_job host:localhost pid:13040') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 
D, [2015-06-14T16:05:40.986701 #24767] DEBUG -- : SQL (0.6ms) UPDATE `delayed_jobs` SET `delayed_jobs`.`locked_at` = '2015-06-14 16:05:40', `delayed_jobs`.`locked_by` = 'delayed_job host:localhost pid:24767' WHERE ((run_at <= '2015-06-14 16:05:40.984123' AND (locked_at IS NULL OR locked_at < '2015-06-14 12:05:40.984213') OR locked_by = 'delayed_job host:localhost pid:24767') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 
D, [2015-06-14T16:05:41.624208 #2864] DEBUG -- : SQL (0.4ms) UPDATE `delayed_jobs` SET `delayed_jobs`.`locked_at` = '2015-06-14 16:05:41', `delayed_jobs`.`locked_by` = 'delayed_job host:localhost pid:2864' WHERE ((run_at <= '2015-06-14 16:05:41.622350' AND (locked_at IS NULL OR locked_at < '2015-06-14 12:05:41.622408') OR locked_by = 'delayed_job host:localhost pid:2864') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 
D, [2015-06-14T16:05:43.805954 #32414] DEBUG -- : SQL (0.5ms) UPDATE `delayed_jobs` SET `delayed_jobs`.`locked_at` = '2015-06-14 16:05:43', `delayed_jobs`.`locked_by` = 'delayed_job host:localhost pid:32414' WHERE ((run_at <= '2015-06-14 16:05:43.803737' AND (locked_at IS NULL OR locked_at < '2015-06-14 12:05:43.803805') OR locked_by = 'delayed_job host:localhost pid:32414') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 
D, [2015-06-14T16:05:45.685733 #13040] DEBUG -- : SQL (0.4ms) UPDATE `delayed_jobs` SET `delayed_jobs`.`locked_at` = '2015-06-14 16:05:45', `delayed_jobs`.`locked_by` = 'delayed_job host:localhost pid:13040' WHERE ((run_at <= '2015-06-14 16:05:45.684133' AND (locked_at IS NULL OR locked_at < '2015-06-14 12:05:45.684179') OR locked_by = 'delayed_job host:localhost pid:13040') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 
D, [2015-06-14T16:05:45.989291 #24767] DEBUG -- : SQL (0.5ms) UPDATE `delayed_jobs` SET `delayed_jobs`.`locked_at` = '2015-06-14 16:05:45', `delayed_jobs`.`locked_by` = 'delayed_job host:localhost pid:24767' WHERE ((run_at <= '2015-06-14 16:05:45.987317' AND (locked_at IS NULL OR locked_at < '2015-06-14 12:05:45.987369') OR locked_by = 'delayed_job host:localhost pid:24767') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 
D, [2015-06-14T16:05:46.616535 #24767] DEBUG -- : (0.3ms) SELECT COUNT(*) FROM `delayed_jobs` WHERE (failed_at is not NULL) 
D, [2015-06-14T16:05:46.617620 #24767] DEBUG -- : (0.3ms) SELECT COUNT(*) FROM `delayed_jobs` WHERE (locked_by is not NULL) 
D, [2015-06-14T16:05:46.619464 #24767] DEBUG -- : (0.4ms) SELECT COUNT(*) AS count_all, priority AS priority FROM `delayed_jobs` WHERE (run_at <= '2015-06-14 16:05:46.618279' and failed_at is NULL) GROUP BY `delayed_jobs`.`priority` 
D, 

延遲作業表通常是空的,作業被快速處理。

+1

你也可以[設置delayed_job登錄到一個單獨的文件] [1]。 [1]:http://stackoverflow.com/questions/10240094/have-delayed-job-log-puts-sql-queries-and-jobs-status/16475095#16475095 – wesgarrison

回答

0

這是正常現象,您必須在config/environments/production.rb:debug之間設置log_level

將其更改爲:info將不會使用延遲作業的調試註釋更新生產日誌。