feat: refactor go.mod.

This commit is contained in:
tx7do
2024-11-14 16:49:40 +08:00
parent 9e9d634935
commit 16cccfe6ab
6 changed files with 1382 additions and 250 deletions

View File

@@ -31,11 +31,15 @@ func NewEntClient[T ClientInterface](cfg *conf.Bootstrap, l *log.Helper, db T) *
wrapperClient := NewEntClientWrapper(db, drv)
wrapperClient.SetConnectionOption(
int(cfg.Data.Database.GetMaxIdleConnections()),
int(cfg.Data.Database.GetMaxOpenConnections()),
cfg.Data.Database.GetConnectionMaxLifetime().AsDuration(),
)
if cfg.Data.Database.MaxIdleConnections != nil &&
cfg.Data.Database.MaxOpenConnections != nil &&
cfg.Data.Database.ConnectionMaxLifetime != nil {
wrapperClient.SetConnectionOption(
int(cfg.Data.Database.GetMaxIdleConnections()),
int(cfg.Data.Database.GetMaxOpenConnections()),
cfg.Data.Database.GetConnectionMaxLifetime().AsDuration(),
)
}
return wrapperClient
}