aboutsummaryrefslogtreecommitdiffstats
path: root/models/models.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-10-21 22:20:47 +0100
committerGitHub <noreply@github.com>2019-10-21 22:20:47 +0100
commitd8161ee3fd5d2991f70523b03421af4e6cf5b513 (patch)
treea8b50be951b69c6d2a10ebaf514ed2bede7f750b /models/models.go
parent73f8069249f2b88bbe42a8fc3db06f0e91719200 (diff)
downloadgitea-d8161ee3fd5d2991f70523b03421af4e6cf5b513.tar.gz
gitea-d8161ee3fd5d2991f70523b03421af4e6cf5b513.zip
Expose db.SetMaxOpenConns and allow non MySQL dbs to set conn pool params (#8528)
* 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.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/models/models.go b/models/models.go
index 0454ec6add..854cb33b14 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
}