In one of my project i am using Sidekiq
Is there any inbuilt Sidekiq console method/method that helps me to find whether sidekiq is running or not.
My requirement is kind of a pre check condition where if Sidekiq is not running i will raise a error.
I tried using the grep like
'ps -ef | grep sidekiq'
but it's not solving my purpose.
The method i am looking for should be something like:
Sidekiq.is_running?
Thanks in advance.
I also Tried
Sidekiq not running
1.9.3p392 :021 > system 'ps aux | grep sidekiq'
ankitgupta 6683 0.0 0.0 2432768 600 s001 R+ 11:47AM 0:00.00 grep sidekiq
ankitgupta 6681 0.0 0.0 2433432 916 s001 S+ 11:47AM 0:00.01 sh -c ps aux | grep sidekiq
=> true
Sidekiq is running
1.9.3p392 :022 > system 'ps aux | grep sidekiq'
ankitgupta 6725 0.0 0.0 2432768 600 s001 S+ 11:57AM 0:00.00 grep sidekiq
ankitgupta 6723 0.0 0.0 2433432 916 s001 S+ 11:57AM 0:00.00 sh -c ps aux | grep sidekiq
ankitgupta 6707 0.0 1.3 3207416 111608 s002 S+ 11:56AM 0:07.46 sidekiq 2.11.2 project_name [0 of 25 busy]
=> true
It is always returning true.. I want to catch the process when it runs