mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
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:
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user