From 442c902d2c22314243121364e4dc33ee8be7915a Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 9 Sep 2020 19:17:42 +0100 Subject: [PATCH] Move all rails job queue runners to the frontends --- cookbooks/web/recipes/backend.rb | 14 +++----------- cookbooks/web/recipes/frontend.rb | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/cookbooks/web/recipes/backend.rb b/cookbooks/web/recipes/backend.rb index 50e84c9df..871f692d9 100644 --- a/cookbooks/web/recipes/backend.rb +++ b/cookbooks/web/recipes/backend.rb @@ -43,17 +43,9 @@ apache_site "www.openstreetmap.org" do end service "rails-jobs@storage" do - action [:enable, :start] - supports :restart => true - subscribes :restart, "rails_port[www.openstreetmap.org]" - subscribes :restart, "systemd_service[rails-jobs]" + action [:disable, :stop] end -if node[:web][:primary_cluster] - service "rails-jobs@traces" do - action [:enable, :start] - supports :restart => true - subscribes :restart, "rails_port[www.openstreetmap.org]" - subscribes :restart, "systemd_service[rails-jobs]" - end +service "rails-jobs@traces" do + action [:disable, :stop] end diff --git a/cookbooks/web/recipes/frontend.rb b/cookbooks/web/recipes/frontend.rb index 50fcc5a05..cb712d458 100644 --- a/cookbooks/web/recipes/frontend.rb +++ b/cookbooks/web/recipes/frontend.rb @@ -66,3 +66,23 @@ service "rails-jobs@mailers" do subscribes :restart, "rails_port[www.openstreetmap.org]" subscribes :restart, "systemd_service[rails-jobs]" end + +service "rails-jobs@storage" do + action [:enable, :start] + supports :restart => true + subscribes :restart, "rails_port[www.openstreetmap.org]" + subscribes :restart, "systemd_service[rails-jobs]" +end + +if node[:web][:primary_cluster] + service "rails-jobs@traces" do + action [:enable, :start] + supports :restart => true + subscribes :restart, "rails_port[www.openstreetmap.org]" + subscribes :restart, "systemd_service[rails-jobs]" + end +else + service "rails-jobs@traces" do + action [:disable, :stop] + end +end -- 2.39.5