lib/puma/plugin/systemd.rb
# If watchdog is configured we'll send a ping at about half the timeout
# configured in systemd as recommended in the docs.
If watchdog is configured we'll send a ping at about half the timeout
configured in systemd as recommended in the docs.
If watchdog is configured we ' ll send a ping at about half the timeout configured in systemd as recommended in the docs .
def watchdog_loop
    @launcher.events.log "* systemd: watchdog detected (#{@systemd.watchdog_usec}usec)"
    sleep_seconds = @systemd.watchdog_usec / 1000.0 / 1000.0 / 2.0
    loop do
      begin
        @launcher.events.debug "systemd: notify watchdog"
        @systemd.notify_watchdog
      rescue
        @launcher.events.error "! systemd: notify watchdog failed:\n  #{$!.to_s}\n  #{$!.backtrace.join("\n    ")}"
      ensure
        @launcher.events.debug "systemd: sleeping #{sleep_seconds}s"
        sleep sleep_seconds
      end
    end
  end
def watchdog_loop @launcher . events . log "* systemd: watchdog detected (#{@systemd.watchdog_usec}usec)" sleep_seconds = @systemd . watchdog_usec / 1000.0 / 1000.0 / 2.0 loop do begin @launcher . events . debug "systemd: notify watchdog" @systemd . notify_watchdog rescue @launcher . events . error "! systemd: notify watchdog failed:\n  #{$!.to_s}\n  #{$!.backtrace.join("\n    ")}" ensure @launcher . events . debug "systemd: sleeping #{sleep_seconds}s" sleep sleep_seconds end end end
If watchdog is configured we'll send a ping at about half the timeout
configured in systemd as recommended in the docs.
If watchdog is configured we ' ll send a ping at about half the timeout configured in systemd as recommended in the docs .
# Ruby wants seconds, and the docs suggest notifying halfway through the # timeout.