From 5542ee540f9d9f3e166d8f7fdfabb804efa233b8 Mon Sep 17 00:00:00 2001 From: Geoff Wilson Date: Fri, 18 Aug 2023 09:34:00 -0400 Subject: [PATCH] Lint complaints --- pkg/database/db_factory.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/pkg/database/db_factory.go b/pkg/database/db_factory.go index e8bb3a52c..f1b623bd7 100644 --- a/pkg/database/db_factory.go +++ b/pkg/database/db_factory.go @@ -245,7 +245,7 @@ func (f SqliteDbFactory) MakeDbInstance() (*DbInstance, error) { Conn: r, } - logURL := *&f.dsnURL + logURL := f.dsnURL q = logURL.Query() if q.Has("_key") { q.Set("_key", "xxxxx") @@ -276,15 +276,13 @@ func (f SqliteDbFactory) MakeDbInstance() (*DbInstance, error) { return nil, fmt.Errorf("failed to connect to database: %w", err) } - if replicaConn != nil { - db.Use( - dbresolver.Register(dbresolver.Config{ - Replicas: []gorm.Dialector{ - replicaConn, - }, - }), - ) - } + db.Use( + dbresolver.Register(dbresolver.Config{ + Replicas: []gorm.Dialector{ + replicaConn, + }, + }), + ) sqlDB, _ := db.DB.DB() sqlDB.SetConnMaxIdleTime(time.Minute)