mirror of
https://github.com/mattermost/mattermost.git
synced 2026-09-21 22:33:22 +08:00
MM-41211: Allows rollback without destroying previous config setting. (#20137)
* MM-41211: Allows rollback without destroying previous config setting. * MM-41211: Revert to original logic for unused config settings. * MM-41211: Moves days defaults before hours defaults. Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
This commit is contained in:
co-authored by
Mattermod
parent
2c5f816e02
commit
cd487c812c
+20
-3
@@ -599,6 +599,14 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
|
||||
s.ExtendSessionLengthWithActivity = NewBool(!isUpdate)
|
||||
}
|
||||
|
||||
if s.SessionLengthWebInDays == nil {
|
||||
if isUpdate {
|
||||
s.SessionLengthWebInDays = NewInt(180)
|
||||
} else {
|
||||
s.SessionLengthWebInDays = NewInt(30)
|
||||
}
|
||||
}
|
||||
|
||||
if s.SessionLengthWebInHours == nil {
|
||||
var webTTLDays int
|
||||
if s.SessionLengthWebInDays == nil {
|
||||
@@ -612,7 +620,14 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
|
||||
}
|
||||
s.SessionLengthWebInHours = NewInt(webTTLDays * 24)
|
||||
}
|
||||
s.SessionLengthWebInDays = NewInt(-1)
|
||||
|
||||
if s.SessionLengthMobileInDays == nil {
|
||||
if isUpdate {
|
||||
s.SessionLengthMobileInDays = NewInt(180)
|
||||
} else {
|
||||
s.SessionLengthMobileInDays = NewInt(30)
|
||||
}
|
||||
}
|
||||
|
||||
if s.SessionLengthMobileInHours == nil {
|
||||
var mobileTTLDays int
|
||||
@@ -627,7 +642,10 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
|
||||
}
|
||||
s.SessionLengthMobileInHours = NewInt(mobileTTLDays * 24)
|
||||
}
|
||||
s.SessionLengthMobileInDays = NewInt(-1)
|
||||
|
||||
if s.SessionLengthSSOInDays == nil {
|
||||
s.SessionLengthSSOInDays = NewInt(30)
|
||||
}
|
||||
|
||||
if s.SessionLengthSSOInHours == nil {
|
||||
var ssoTTLDays int
|
||||
@@ -638,7 +656,6 @@ func (s *ServiceSettings) SetDefaults(isUpdate bool) {
|
||||
}
|
||||
s.SessionLengthSSOInHours = NewInt(ssoTTLDays * 24)
|
||||
}
|
||||
s.SessionLengthSSOInDays = NewInt(-1)
|
||||
|
||||
if s.SessionCacheInMinutes == nil {
|
||||
s.SessionCacheInMinutes = NewInt(10)
|
||||
|
||||
Reference in New Issue
Block a user