feat(*): initial commit
build / Go-Build (push) Successful in 1m1s

This commit is contained in:
2026-06-24 00:16:21 +02:00
parent 3cf9e6f266
commit 85e4df52a5
20 changed files with 1125 additions and 3 deletions
+14
View File
@@ -3,6 +3,7 @@ package database
import (
"database/sql"
"log"
"time"
"github.com/lib/pq"
)
@@ -17,11 +18,24 @@ func OpenDB(conf pq.Config) {
}
db = sql.OpenDB(connector)
db.SetMaxOpenConns(500)
db.SetMaxIdleConns(50)
db.SetConnMaxLifetime(time.Hour)
if err := db.Ping(); err != nil {
panic(err)
}
log.Printf("Database opened to %s:%d, %s as %s!\n", conf.Host, conf.Port, conf.Database, conf.User)
if err := initStateDB(); err != nil {
panic(err)
}
if err := initVoteDB(); err != nil {
panic(err)
}
}
func CloseDB() {