Skip to content

Commit

Permalink
Set the max number of connections to 10 and reuse them.
Browse files Browse the repository at this point in the history
  • Loading branch information
clems4ever committed Jan 26, 2021
1 parent 02f1b9b commit 25ab2d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/database/mariadb.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ func NewMariaDB(username string, password string, host string, databaseName stri
if err != nil {
log.Fatal(err)
}
db.SetMaxIdleConns(0)
db.SetMaxIdleConns(10)
db.SetMaxOpenConns(10)
return &MariaDB{db: db}
}

Expand Down

0 comments on commit 25ab2d1

Please sign in to comment.