didnt work well
This commit is contained in:
10
config/db.go
10
config/db.go
@@ -4,7 +4,6 @@ import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
)
|
||||
@@ -29,15 +28,6 @@ func ConnectToPostgreSQL() (*sql.DB, error) {
|
||||
|
||||
fmt.Println("Connection to PostgreSQL opened successfully :D")
|
||||
|
||||
// Set the maximum number of open connections to 20
|
||||
db.SetMaxOpenConns(20)
|
||||
|
||||
// Set the maximum number of idle connections to 10
|
||||
db.SetMaxIdleConns(10)
|
||||
|
||||
// Set the maximum connection lifetime to 1 hour
|
||||
db.SetConnMaxLifetime(1 * time.Hour)
|
||||
|
||||
// Ping database to verify connection
|
||||
err = db.Ping()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user