Rails 3.2.14 / Ruby 2.0.0 / Delayed Job 4.1.4 / Foreman
I'm running a worker with Delayed Job, starting the process with Foreman. It all works fine but my dev logs are full of Delayed Job SQL statements. It makes debugging anything in development tiresome. Every 5 seconds I get a big chunk like this:
17:40:26 worker.1 | Delayed::Backend::ActiveRecord::Job Load (0.9ms) UPDATE "delayed_jobs" SET locked_at = '2020-03-25 00:40:26.874025', locked_by = 'host:MacBook-Pro-8.local pid:67410' WHERE id IN (SELECT id FROM "delayed_jobs" WHERE ((run_at <= '2020-03-25 00:40:26.873540' AND (locked_at IS NULL OR locked_at < '2020-03-24 20:40:26.873551') OR locked_by = 'host:MacBook-Pro-8.local pid:67410') AND failed_at IS NULL) ORDER BY priority ASC, run_at ASC LIMIT 1 FOR UPDATE) RETURNING *
How do quiet these SQL logs from Delayed Job? I tried a few solutions form the interwebs but nothing worked so far 😕
Mostly from this thread: https://github.com/collectiveidea/delayed_job/issues/886
For now I've changed the timer from default 5 seconds to 60 seconds with this:
Delayed::Worker.sleep_delay = 60
Join 31,152+ developers who get early access to new screencasts, articles, guides, updates, and more.