Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Task to check status of your Sidekiq process
namespace :check_services do
task :sidekiq => :environment do
path = "path/to/",'r').read.gsub("\n",'')
result = IO.popen("ps aux | grep sidekiq").gets.include?(pid)
unless result
system "command_to_run_your_sidekiq" # For Example: bundle exec sidekiq -C config/sidekiq.yml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment