From 8bedc3466f0419c49c335eff9f6da6ee0de3bb16 Mon Sep 17 00:00:00 2001 From: Elijah Duffy Date: Tue, 3 Jun 2025 14:59:25 -0700 Subject: [PATCH] upgrade for latest version of go-toolkit/app --- db.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/db.go b/db.go index 2f4e193..c1ea52f 100644 --- a/db.go +++ b/db.go @@ -64,7 +64,7 @@ func ModuleDB(cfg DBConfig, forceDebugLog bool) *app.Module { // setupDB connects to the MySQL DB and initializes the goose migration provider. // If auto migrations are enabled in configuration, latest migrations are applied. -func setupDB() error { +func setupDB(_ *app.Module) error { if sqlDB != nil && sqlDB.Ping() == nil { dbModule.Logger().Warn("Database connection already established") return nil @@ -105,15 +105,17 @@ func setupDB() error { } // teardownDB closes the database connection. -func teardownDB() { +func teardownDB(_ *app.Module) error { if sqlDB == nil { - return + return nil } if err := sqlDB.Close(); err != nil { dbModule.Logger().Error("Couldn't close database", "err", err) + return err } dbModule.Logger().Info("Closed database connection") + return nil } // Queryable interface is an SQL driver object that can execute SQL statements