From 38e9976ce499f76a1462bfc93c05975283030c35 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Wed, 22 May 2019 03:36:07 +1000 Subject: [PATCH] Make inserting delayed jobs from cron quiet `config/schedule.rb` defines entries for cron jobs. Every five minutes it insert several delayed jobs via `script/enqueue`. A recent upgrade of Postgresql (a year or two ago) made that script noisy. Every time we insert a delayed job with that script it outputs: INSERT 0 1 Standard output like this is seen as error message by cron an forwarded to the unix user's local mailbox in `/var/mail/openfoodnetwork`. This file grows over time and accumulates tens of thousands of error messages, hiding any important failures. This patch makes inserting delayed jobs quiet. A failure is still reported. --- script/enqueue | 1 + 1 file changed, 1 insertion(+) diff --git a/script/enqueue b/script/enqueue index 2071414e4e..165774b878 100755 --- a/script/enqueue +++ b/script/enqueue @@ -26,6 +26,7 @@ def psql raise "Missing config for #{env} environment" unless config "psql".tap do |s| + s << " --quiet" s << " --host #{config['host']}" if config['host'] s << " --user #{config['username']}" if config['username'] s << " --port #{config['port']}" if config['port']