Skip to content

Commit 25ab2d1

Browse files
committed
Set the max number of connections to 10 and reuse them.
1 parent 02f1b9b commit 25ab2d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

internal/database/mariadb.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ func NewMariaDB(username string, password string, host string, databaseName stri
3030
if err != nil {
3131
log.Fatal(err)
3232
}
33-
db.SetMaxIdleConns(0)
33+
db.SetMaxIdleConns(10)
34+
db.SetMaxOpenConns(10)
3435
return &MariaDB{db: db}
3536
}
3637

0 commit comments

Comments
 (0)