Added debug logging by sending heartbeats.
This commit is contained in:
@@ -11,8 +11,10 @@ class SystemdNotifier
|
||||
MethodExecutor.record("error", "heartbeat", "NOTIFY_SOCKET is not set or is not a socket, am I a service?")
|
||||
@enable_heartbeat = false
|
||||
else
|
||||
MethodExecutor.record("debug", "heartbeat", "Found NOTIFY_SOCKET, enabling heartbeat")
|
||||
@enable_heartbeat = true
|
||||
@socket = UNIXSocket.new(@notify_socket)
|
||||
MethodExecutor.record("debug", "heartbeat", "Heartbeat socket opened")
|
||||
end
|
||||
|
||||
def enabled?
|
||||
@@ -24,6 +26,7 @@ class SystemdNotifier
|
||||
|
||||
begin
|
||||
@socket.send(message, 0)
|
||||
MethodExecutor.record("debug", "heartbeat", "Heartbeat sent: #{message}")
|
||||
rescue => e
|
||||
MethodExecutor.error("heartbeat", "Failed to send heartbeat: #{e}")
|
||||
@enable_heartbeat = false
|
||||
|
||||
Reference in New Issue
Block a user