Merge pull request #5699 from swordqiu/automated-cherry-pick-of-#5698-upstream-release-3.1

Automated cherry pick of #5698: fix: service config changes not effective
This commit is contained in:
Zexi Li
2020-04-07 10:38:30 +08:00
committed by GitHub
7 changed files with 27 additions and 16 deletions
+3 -2
View File
@@ -40,9 +40,10 @@ func OnOptionsChange(oldO, newO interface{}) bool {
oldOpts := oldO.(*GatewayOptions)
newOpts := newO.(*GatewayOptions)
changed := false
if common_options.OnCommonOptionsChange(&oldOpts.CommonOptions, &newOpts.CommonOptions) {
return true
changed = true
}
return false
return changed
}
+3
View File
@@ -16,6 +16,8 @@ package consts
import (
"time"
"yunion.io/x/log"
)
var (
@@ -58,6 +60,7 @@ func GetTenantCacheExpireSeconds() time.Duration {
}
func SetNonDefaultDomainProjects(val bool) {
log.Infof("set non_default_domain_projects to %v", val)
nonDefaultDomainProjects = val
}
+10 -6
View File
@@ -22,27 +22,31 @@ func OnBaseOptionsChange(oOpts, nOpts interface{}) bool {
oldOpts := oOpts.(*BaseOptions)
newOpts := nOpts.(*BaseOptions)
changed := false
if oldOpts.RequestWorkerCount != newOpts.RequestWorkerCount {
return true
changed = true
}
if oldOpts.TimeZone != newOpts.TimeZone {
return true
changed = true
}
if oldOpts.EnableRbac != newOpts.EnableRbac {
return true
changed = true
}
if oldOpts.NonDefaultDomainProjects != newOpts.NonDefaultDomainProjects {
consts.SetNonDefaultDomainProjects(newOpts.NonDefaultDomainProjects)
changed = true
}
return false
return changed
}
func OnCommonOptionsChange(oOpts, nOpts interface{}) bool {
oldOpts := oOpts.(*CommonOptions)
newOpts := nOpts.(*CommonOptions)
changed := false
if OnBaseOptionsChange(&oldOpts.BaseOptions, &newOpts.BaseOptions) {
return true
changed = true
}
return false
return changed
}
+3 -2
View File
@@ -141,8 +141,9 @@ func OnOptionsChange(oldO, newO interface{}) bool {
oldOpts := oldO.(*ComputeOptions)
newOpts := newO.(*ComputeOptions)
changed := false
if common_options.OnCommonOptionsChange(&oldOpts.CommonOptions, &newOpts.CommonOptions) {
return true
changed = true
}
return false
return changed
}
+3 -2
View File
@@ -51,9 +51,10 @@ func OnOptionsChange(oldO, newO interface{}) bool {
oldOpts := oldO.(*SImageOptions)
newOpts := newO.(*SImageOptions)
changed := false
if common_options.OnCommonOptionsChange(&oldOpts.CommonOptions, &newOpts.CommonOptions) {
return true
changed = true
}
return false
return changed
}
+3 -2
View File
@@ -53,9 +53,10 @@ func OnOptionsChange(oldOptions, newOptions interface{}) bool {
oldOpts := oldOptions.(*SKeystoneOptions)
newOpts := newOptions.(*SKeystoneOptions)
changed := false
if options.OnBaseOptionsChange(&oldOpts.BaseOptions, &newOpts.BaseOptions) {
return true
changed = true
}
return false
return changed
}
+2 -2
View File
@@ -26,8 +26,8 @@ type NotifyOption struct {
SocketFileDir string `help:"Socket file directory" default:"/etc/yunion/notify"`
UpdateInterval int `help:"Update send services interval(unit:min)" default:"30"`
VerifyEmailUrl string `help:"url of verify email"`
ReSendScope int `help:"Resend all messages that have not been sent successfully within ReSendScope
seconds" default:"30"`
ReSendScope int `help:"Resend all messages that have not been sent successfully within ReSendScope seconds" default:"30"`
InitNotificationScope int `help:"initialize data of notification with in InitNotificationScope hours" default:"100"`
}