Skip to content

Commit

Permalink
Stop sending logs about systemd notifications when it's not initializ…
Browse files Browse the repository at this point in the history
…ed (#18)

Co-authored-by: Yury Frolov <[email protected]>
  • Loading branch information
EinKrebs and Yury Frolov authored Dec 22, 2023
1 parent 4d79e76 commit 398d192
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/sdnotifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,11 @@ func (n *Notifier) Notify() error {
}

func (n *Notifier) send(msg []byte) error {
ylogger.Zero.Debug().Msg(fmt.Sprintf("sending systemd notification: %s", msg))

if n.sock == nil {
return nil
}

ylogger.Zero.Debug().Msg(fmt.Sprintf("sending systemd notification: %s", msg))
_, err := n.sock.Write(msg)

if n.debug {
Expand Down

0 comments on commit 398d192

Please sign in to comment.