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