fix(cloudcommon): service config informer doesn't start watching (#19005)

This commit is contained in:
Zexi Li
2023-12-15 14:58:35 +08:00
committed by GitHub
parent 1a6c31db45
commit 6e9253b504
2 changed files with 5 additions and 3 deletions
+4 -2
View File
@@ -60,12 +60,12 @@ func StartOptionManager(option interface{}, refreshSeconds int, serviceType, ser
}
func StartOptionManagerWithSessionDriver(options interface{}, refreshSeconds int, serviceType, serviceVersion string, onChange TOptionsChangeFunc, session IServiceConfigSession) {
log.Infof("OptionManager start to fetch service configs ...")
if refreshSeconds <= MIN_REFRESH_INTERVAL_SECONDS {
// a minimal 30 seconds refresh interval
refreshSeconds = MIN_REFRESH_INTERVAL_SECONDS
}
refreshInterval := time.Duration(refreshSeconds) * time.Second
log.Infof("OptionManager start to fetch service configs with interval %s ...", refreshInterval)
OptionManager = &SOptionManager{
serviceType: serviceType,
serviceVersion: serviceVersion,
@@ -77,7 +77,9 @@ func StartOptionManagerWithSessionDriver(options interface{}, refreshSeconds int
OptionManager.InitSync(OptionManager)
OptionManager.FirstSync()
if err := OptionManager.FirstSync(); err != nil {
log.Errorf("OptionManager.FirstSync error: %v", err)
}
if session.IsRemote() {
var opts *CommonOptions
+1 -1
View File
@@ -137,7 +137,7 @@ type CommonOptions struct {
TenantCacheExpireSeconds int `help:"expire seconds of cached tenant/domain info. defailt 15 minutes" default:"900"`
SessionEndpointType string `help:"Client session end point type"`
SessionEndpointType string `help:"Client session end point type" default:"internal"`
BaseOptions
}