module Puma::SdNotify

def self.watchdog?

Other tags:
    Note: - Unlike sd_watchdog_enabled(3), this method does not mutate the

Parameters:
  • true (Boolean) -- if the service manager expects watchdog keep-alive
def self.watchdog?
  wd_usec = ENV["WATCHDOG_USEC"]
  wd_pid = ENV["WATCHDOG_PID"]
  return false if !wd_usec
  begin
    wd_usec = Integer(wd_usec)
  rescue
    return false
  end
  return false if wd_usec <= 0
  return true if !wd_pid || wd_pid == $$.to_s
  false
end