Skip to content

Commit

Permalink
Lint complaints
Browse files Browse the repository at this point in the history
  • Loading branch information
suprjinx committed Aug 18, 2023
1 parent b93e91c commit 5542ee5
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions pkg/database/db_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5542ee5

Please sign in to comment.