From 59286d2c7ede928cc24916abdf6c0fb9ee12b826 Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Fri, 2 Sep 2022 09:23:51 -0600 Subject: notify: Don't send ready after error (fix #5003) Also simplify the notify package quite a bit. Also move stop notification into better place. Add ability to send status or error. --- notify/notify_windows.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'notify/notify_windows.go') diff --git a/notify/notify_windows.go b/notify/notify_windows.go index a551fc7..5666a4c 100644 --- a/notify/notify_windows.go +++ b/notify/notify_windows.go @@ -24,7 +24,7 @@ func SetGlobalStatus(status chan<- svc.Status) { globalStatus = status } -func notifyReadiness() error { +func Ready() error { if globalStatus != nil { globalStatus <- svc.Status{ State: svc.Running, @@ -34,16 +34,22 @@ func notifyReadiness() error { return nil } -func notifyReloading() error { +func Reloading() error { if globalStatus != nil { globalStatus <- svc.Status{State: svc.StartPending} } return nil } -func notifyStopping() error { +func Stopping() error { if globalStatus != nil { globalStatus <- svc.Status{State: svc.StopPending} } return nil } + +// TODO: not implemented +func Status(_ string) error { return nil } + +// TODO: not implemented +func Error(_ error, _ int) error { return nil } -- cgit v1.2.3