File: resque_health_check.rb

package info (click to toggle)
ruby-health-check 3.0.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 256 kB
  • sloc: sh: 1,021; ruby: 596; makefile: 3
file content (15 lines) | stat: -rw-r--r-- 410 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
module HealthCheck
   class ResqueHealthCheck
     extend BaseHealthCheck

     def self.check
       unless defined?(::Resque)
         raise "Wrong configuration. Missing 'resque' gem"
       end
      res = ::Resque.redis.ping
      res == 'PONG' ? '' : "Resque.redis.ping returned #{res.inspect} instead of PONG"
     rescue Exception => e
       create_error 'resque-redis', e.message
     end
   end
end