remove if condition because it is handled by the sdNotify daemon func

Signed-off-by: fahedouch <fahed.dorgaa@gmail.com>

lint code

Signed-off-by: fahedouch <fahed.dorgaa@gmail.com>
This commit is contained in:
fahedouch 2020-04-26 19:12:01 +02:00
parent 36952e989a
commit 8e76d18eff

View File

@ -20,7 +20,6 @@ package command
import (
"context"
"os"
sd "github.com/coreos/go-systemd/v22/daemon"
@ -38,15 +37,11 @@ func notifyStopping(ctx context.Context) error {
}
func sdNotify(ctx context.Context, state string) error {
if os.Getenv("NOTIFY_SOCKET") != "" {
notified, err := sd.SdNotify(false, state)
log.G(ctx).
WithError(err).
WithField("notified", notified).
WithField("state", state).
Debug("sd notification")
return err
}
return nil
notified, err := sd.SdNotify(false, state)
log.G(ctx).
WithError(err).
WithField("notified", notified).
WithField("state", state).
Debug("sd notification")
return err
}