From 2a0eac257242d9e2ab47acbb59e5e092a1f5cc10 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Fri, 26 Aug 2022 15:00:08 +0100 Subject: [PATCH] Increase sleep interval when rails workers have nothing to do --- cookbooks/dev/recipes/default.rb | 1 + cookbooks/web/recipes/rails.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbooks/dev/recipes/default.rb b/cookbooks/dev/recipes/default.rb index 70742e3c6..3a12babae 100644 --- a/cookbooks/dev/recipes/default.rb +++ b/cookbooks/dev/recipes/default.rb @@ -230,6 +230,7 @@ if node[:postgresql][:clusters][:"14/main"] systemd_service "rails-jobs@" do description "Rails job queue runner" type "simple" + environment "RAILS_ENV" => "production", "SLEEP_DELAY" => "60" user "apis" working_directory "/srv/%i.apis.dev.openstreetmap.org/rails" exec_start "#{node[:ruby][:bundle]} exec rails jobs:work" diff --git a/cookbooks/web/recipes/rails.rb b/cookbooks/web/recipes/rails.rb index 4cc91d2b4..e021f1925 100644 --- a/cookbooks/web/recipes/rails.rb +++ b/cookbooks/web/recipes/rails.rb @@ -152,7 +152,7 @@ end systemd_service "rails-jobs@" do description "Rails job queue runner" type "simple" - environment "RAILS_ENV" => "production", "QUEUE" => "%I" + environment "RAILS_ENV" => "production", "QUEUE" => "%I", "SLEEP_DELAY" => "60" user "rails" working_directory rails_directory exec_start "#{node[:ruby][:bundle]} exec rails jobs:work" -- 2.39.5