Skip to content

Commit

Permalink
errcheck: discard not used error return values
Browse files Browse the repository at this point in the history
  • Loading branch information
oxzi committed Oct 8, 2024
1 parent 20fbda2 commit f5619fd
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/icingadb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ func run() int {
_ = sdnotify.Ready()

logger := logs.GetLogger()
defer logger.Sync()
defer func() { _ = logger.Sync() }()

logger.Infof("Starting Icinga DB daemon (%s)", internal.Version.Version)

db, err := cmd.Database(logs.GetChildLogger("database"))
if err != nil {
logger.Fatalf("%+v", errors.Wrap(err, "can't create database connection pool from config"))
}
defer db.Close()
defer func() { _ = db.Close() }()
{
logger.Infof("Connecting to database at '%s'", db.GetAddr())
err := db.Ping()
Expand Down Expand Up @@ -112,7 +112,7 @@ func run() int {
if err != nil {
logger.Fatalf("%+v", errors.Wrap(err, "can't create database connection pool from config"))
}
defer db.Close()
defer func() { _ = db.Close() }()
ha = icingadb.NewHA(ctx, db, heartbeat, logs.GetChildLogger("high-availability"))

telemetryLogger := logs.GetChildLogger("telemetry")
Expand All @@ -125,7 +125,7 @@ func run() int {
// Give up after 3s, not 5m (default) not to hang for 5m if DB is down.
ctx, cancelCtx := context.WithTimeout(context.Background(), 3*time.Second)

ha.Close(ctx)
_ = ha.Close(ctx)
cancelCtx()
}()
s := icingadb.NewSync(db, rc, logs.GetChildLogger("config-sync"))
Expand Down

0 comments on commit f5619fd

Please sign in to comment.