Sha256: 432851f5e603d41219a48abbbfb9820968f2c31115c0f8eeba5ddb8374b623b1
Contents?: true
Size: 426 Bytes
Versions: 26
Compression:
Stored size: 426 Bytes
Contents
module Marty::Diagnostic; class DelayedJobWorkers < Base diagnostic_fn do my_ip = Node.my_ip workers = Database.current_connections.map do |c| ip = c['client_addr'] || '127.0.0.1' name = c['application_name'] name if name.include?('delayed') && (ip == my_ip || ip == '127.0.0.1') end.compact.uniq.count {'Delayed Workers / Node' => workers.zero? ? error(workers) : workers} end end end
Version data entries
26 entries across 26 versions & 1 rubygems