linqueta / rails-healthcheck

A simple way to configure a healthcheck route for a Rails application
MIT License
136 stars 10 forks source link

Check if ActiveJob is working? #62

Closed epugh closed 3 years ago

epugh commented 3 years ago

I am using Redis for ActiveJob, and it would be good to know if it was up and running. How would I add that?

linqueta commented 3 years ago

Are you using Sidekiq (Redis) for ActiveJobs? If it is truth, you can use something like:

  config.add_check :sidekiq,  -> { raise StandardError, 'Sidekiq is down' if Sidekiq::ProcessSet.new.size.zero? }

Sidekiq guide

But, if you want just to check redis, you can use:

  config.add_check :redis,  -> { Redis.new(connection_params).ping }

Redis guide

epugh commented 4 months ago

BTw, I am finally taking advantage of this! Looked at the Rails healthcheck, and it seems too limited for me..