Skip to content

Commit

Permalink
Merge pull request seuros#113 from RetentionGrid/per_process_options
Browse files Browse the repository at this point in the history
Monit configuration respects options_per_process
  • Loading branch information
seuros committed Oct 12, 2015
2 parents 1c74293 + be4814e commit e3e74ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/capistrano/tasks/monit.rake
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ namespace :sidekiq do
end
end

def sidekiq_options_per_process
fetch(:sidekiq_options_per_process) || []
end

def sudo_if_needed(command)
send(use_sudo? ? :sudo : :execute, command)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% processes_pids.each_with_index do |pid_file, idx| %>
check process <%= sidekiq_service_name(idx) %>
with pidfile "<%= pid_file %>"
start program = "/bin/su - <%= @role.user %> -c 'cd <%= current_path %> && <%= SSHKit.config.command_map[:sidekiq] %> <%= sidekiq_config %> --index <%= idx %> --pidfile <%= pid_file %> --environment <%= fetch(:sidekiq_env) %> <%= sidekiq_concurrency %> <%= sidekiq_logfile %> <%= sidekiq_queues %> -d'" with timeout 30 seconds
start program = "/bin/su - <%= @role.user %> -c 'cd <%= current_path %> && <%= SSHKit.config.command_map[:sidekiq] %> <%= sidekiq_config %> --index <%= idx %> --pidfile <%= pid_file %> --environment <%= fetch(:sidekiq_env) %> <%= sidekiq_concurrency %> <%= sidekiq_logfile %> <%= sidekiq_queues %> <%= sidekiq_options_per_process[idx] %> -d'" with timeout 30 seconds

stop program = "/bin/su - <%= @role.user %> -c 'cd <%= current_path %> && <%= SSHKit.config.command_map[:sidekiqctl] %> stop <%= pid_file %>'" with timeout <%= fetch(:sidekiq_timeout).to_i + 10 %> seconds
group <%= fetch(:sidekiq_monit_group, fetch(:application)) %>-sidekiq
Expand Down

0 comments on commit e3e74ef

Please sign in to comment.