Log watchdog/status interactions
This commit is contained in:
parent
30fe78ebdc
commit
e83df05a69
@ -425,7 +425,7 @@ appMain = runResourceT $ do
|
||||
Just wInterval
|
||||
| maybe True (== myProcessID) watchdogProcess
|
||||
-> let notifyWatchdog :: IO ()
|
||||
notifyWatchdog = forever $ do
|
||||
notifyWatchdog = runAppLoggingT foundation . forever $ do
|
||||
d <- liftIO . newDelay . floor $ wInterval % 2
|
||||
|
||||
status <- atomically $ asum
|
||||
@ -438,14 +438,16 @@ appMain = runResourceT $ do
|
||||
]
|
||||
|
||||
case status of
|
||||
Just (_, Min status') -> void . Systemd.notifyStatus . unpack $ toPathPiece status'
|
||||
Just (_, Min status') -> do
|
||||
$logInfoS "NotifyStatus" $ toPathPiece status'
|
||||
liftIO . void . Systemd.notifyStatus . unpack $ toPathPiece status'
|
||||
Nothing -> return ()
|
||||
|
||||
case status of
|
||||
Just (_, Min HealthSuccess)
|
||||
-> void Systemd.notifyWatchdog
|
||||
_other
|
||||
-> return ()
|
||||
Just (_, Min HealthSuccess) -> do
|
||||
$logInfoS "NotifyWatchdog" "Notify"
|
||||
liftIO $ void Systemd.notifyWatchdog
|
||||
_other -> return ()
|
||||
in void $ allocate (async notifyWatchdog >>= \a -> a <$ link a) cancel
|
||||
_other -> return ()
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user