Skip to content

Commit 56d30cb

Browse files
set db
1 parent c145115 commit 56d30cb

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

internal/storage/postgresql/postgresql.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ func NewStore(connStr string, wt time.Duration, rt time.Duration) (*Store, error
2121
return nil, err
2222
}
2323

24-
return &Store{
25-
db: db,
26-
wt: wt,
27-
rt: rt,
28-
}, nil
24+
db.SetMaxOpenConns(25)
25+
db.SetMaxIdleConns(16)
26+
db.SetConnMaxLifetime(5 * time.Minute)
27+
28+
return &Store{db: db, wt: wt, rt: rt}, nil
2929
}
3030

3131
type NullArray struct {

0 commit comments

Comments
 (0)