feat: use connection pooling instead of a single connection

This commit is contained in:
2025-11-21 16:53:46 +01:00
parent 5c239ad61d
commit 0cd428d5d9

View File

@@ -40,11 +40,11 @@ var (
)
func defaultDBConnector(cfg *config.Config) (*gorm.DB, func() error, error) {
db, err := database.Connect(cfg)
poolManager, err := database.ConnectWithPool(cfg)
if err != nil {
return nil, nil, err
}
return db, func() error { return database.Close(db) }, nil
return poolManager.GetDB(), func() error { return poolManager.Close() }, nil
}
func SetDBConnector(connector DBConnector) {