diff options
author | zeripath <art27@cantab.net> | 2019-10-22 07:00:37 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-22 07:00:37 +0100 |
commit | ece768ab6e7f921624a707602466b872032231ad (patch) | |
tree | fcf78e14dde849a4d12723eebc0a9abc2ad3e2ee /models/models.go | |
parent | bac9424a62285e757114d1cc34961b6fa64829f7 (diff) | |
download | gitea-ece768ab6e7f921624a707602466b872032231ad.tar.gz gitea-ece768ab6e7f921624a707602466b872032231ad.zip |
Expose db.SetMaxOpenConns and allow non MySQL dbs to set conn pool params (#8528) (#8618)
* Expose db.SetMaxOpenConns and allow other dbs to set their connection params
* Add note about port exhaustion
Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com>
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/models/models.go b/models/models.go index ea550cb839..b963dec17e 100644 --- a/models/models.go +++ b/models/models.go @@ -157,11 +157,9 @@ func SetEngine() (err error) { // so use log file to instead print to stdout. x.SetLogger(NewXORMLogger(setting.Database.LogSQL)) x.ShowSQL(setting.Database.LogSQL) - if setting.Database.UseMySQL { - x.SetMaxIdleConns(setting.Database.MaxIdleConns) - x.SetConnMaxLifetime(setting.Database.ConnMaxLifetime) - } - + x.SetMaxOpenConns(setting.Database.MaxOpenConns) + x.SetMaxIdleConns(setting.Database.MaxIdleConns) + x.SetConnMaxLifetime(setting.Database.ConnMaxLifetime) return nil } |