From 2e1626086be6d1096f0cd2206086e69f0606cf62 Mon Sep 17 00:00:00 2001 From: Yash Mehrotra Date: Thu, 12 Sep 2024 07:55:45 +0530 Subject: [PATCH] fix: exit early if db initialization fails --- cmd/root.go | 1 + 1 file changed, 1 insertion(+) diff --git a/cmd/root.go b/cmd/root.go index 5366c37b7..91152423b 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -27,6 +27,7 @@ func InitContext() (context.Context, error) { ctx, closer, err := duty.Start("canary-checker", duty.SkipChangelogMigration, duty.SkipMigrationByDefaultMode) if err != nil { logger.Fatalf("Failed to initialize db: %v", err.Error()) + runner.ShutdownAndExit(1, err.Error()) } runner.AddShutdownHook(closer)