From: Tom Hughes Date: Fri, 26 Aug 2022 14:00:08 +0000 (+0100) Subject: Increase sleep interval when rails workers have nothing to do X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/2a0eac257242d9e2ab47acbb59e5e092a1f5cc10?hp=2678c041db64440f0a15a1178d812140d3b90eb7 Increase sleep interval when rails workers have nothing to do --- 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"