add MaxLifetimeconns to server (#9004)

Update e.json string names and remove console log

reorder variables

update db.setConnMaxLifetime to take in *settings.MaxLifetimeConns

Add MaxLifetimeConns to test

Update variable names like MaxLifetimeConns to ConnMaxLifetimeMilliseconds

Update time passed to SetConnMaxLifetime

Revert "Update time passed to SetConnMaxLifetime"

This reverts commit dc1c1b6d5a6404d4ee11c65d4756c19f9316794f.

update en.json

Update supplier_test.go and docker.go ConnMaxLifetimeMilliseconds to 3600000
Этот коммит содержится в:
Jerry Kurian
2018-06-28 09:45:20 -04:00
коммит произвёл Jesse Hallam
родитель 66dc9a5206
Коммит 4b2a626354
7 изменённых файлов: 88 добавлений и 68 удалений

Просмотреть файл

@@ -605,15 +605,16 @@ type SSOSettings struct {
}
type SqlSettings struct {
DriverName *string
DataSource *string
DataSourceReplicas []string
DataSourceSearchReplicas []string
MaxIdleConns *int
MaxOpenConns *int
Trace bool
AtRestEncryptKey string
QueryTimeout *int
DriverName *string
DataSource *string
DataSourceReplicas []string
DataSourceSearchReplicas []string
MaxIdleConns *int
ConnMaxLifetimeMilliseconds *int
MaxOpenConns *int
Trace bool
AtRestEncryptKey string
QueryTimeout *int
}
func (s *SqlSettings) SetDefaults() {
@@ -637,6 +638,10 @@ func (s *SqlSettings) SetDefaults() {
s.MaxOpenConns = NewInt(300)
}
if s.ConnMaxLifetimeMilliseconds == nil {
s.ConnMaxLifetimeMilliseconds = NewInt(3600000)
}
if s.QueryTimeout == nil {
s.QueryTimeout = NewInt(30)
}
@@ -2069,6 +2074,10 @@ func (ss *SqlSettings) isValid() *AppError {
return NewAppError("Config.IsValid", "model.config.is_valid.sql_idle.app_error", nil, "", http.StatusBadRequest)
}
if *ss.ConnMaxLifetimeMilliseconds < 0 {
return NewAppError("Config.IsValid", "model.config.is_valid.sql_conn_max_lifetime_milliseconds.app_error", nil, "", http.StatusBadRequest)
}
if *ss.QueryTimeout <= 0 {
return NewAppError("Config.IsValid", "model.config.is_valid.sql_query_timeout.app_error", nil, "", http.StatusBadRequest)
}