Browse Source

Add single sidekiq process for new scheduler queue

pull/368/head
raucao 7 months ago
parent
commit
a0de016e1c
Signed by: raucao
GPG Key ID: 9F88009D31D99C72
  1. 16
      site-cookbooks/kosmos-mastodon/recipes/default.rb
  2. 17
      site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq-scheduler.systemd.service.erb

16
site-cookbooks/kosmos-mastodon/recipes/default.rb

@ -77,6 +77,18 @@ template "/lib/systemd/system/mastodon-sidekiq.service" do
notifies :restart, "service[mastodon-sidekiq]", :delayed
end
# mastodon-sidekiq-scheduler service
#
template "/lib/systemd/system/mastodon-sidekiq-scheduler.service" do
source "mastodon-sidekiq-scheduler.systemd.service.erb"
variables user: mastodon_user,
app_dir: mastodon_path,
bundle_path: "/opt/ruby_build/builds/#{ruby_version}/bin/bundle",
sidekiq_threads: 1
notifies :run, "execute[systemctl daemon-reload]", :immediately
notifies :restart, "service[mastodon-sidekiq-scheduler]", :delayed
end
# mastodon-streaming service
#
template "/lib/systemd/system/mastodon-streaming.service" do
@ -176,6 +188,10 @@ application mastodon_path do
action [:enable, :start]
end
service "mastodon-sidekiq-scheduler" do
action [:enable, :start]
end
service "mastodon-streaming" do
action [:enable, :start]
end

17
site-cookbooks/kosmos-mastodon/templates/default/mastodon-sidekiq-scheduler.systemd.service.erb

@ -0,0 +1,17 @@
[Unit]
Description=mastodon-sidekiq-scheduler
Requires=redis-server.service
After=redis-server.service
[Service]
Type=simple
User=<%= @user %>
WorkingDirectory=<%= @app_dir %>
Environment="RAILS_ENV=production"
Environment="LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1"
ExecStart=<%= @bundle_path %> exec sidekiq -c <%= @sidekiq_threads %> -q scheduler
TimeoutSec=15
Restart=always
[Install]
WantedBy=multi-user.target
Loading…
Cancel
Save