Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upstart update #261

Merged
merged 2 commits into from Jul 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/capistrano/tasks/upstart.rake
@@ -1,11 +1,13 @@
git_plugin = self

SUPPRESS_FAILURE = %w[|| echo NO_RUNNING_INSTANCE].freeze

namespace :sidekiq do
desc 'Quiet sidekiq (stop fetching new tasks from Redis)'
task :quiet do
on roles fetch(:sidekiq_roles) do |role|
git_plugin.switch_user(role) do
sudo :service, fetch(:sidekiq_service_unit_name), :reload
sudo :service, fetch(:sidekiq_service_unit_name), :reload, *SUPPRESS_FAILURE
end
end
end
Expand All @@ -14,7 +16,7 @@ namespace :sidekiq do
task :stop do
on roles fetch(:sidekiq_roles) do |role|
git_plugin.switch_user(role) do
sudo :service, fetch(:sidekiq_service_unit_name), :stop
sudo :service, fetch(:sidekiq_service_unit_name), :stop, *SUPPRESS_FAILURE
end
end
end
Expand Down