Skip to content

Commit

Permalink
fix(cloudcommon): service config informer doesn't start watching (#19005
Browse files Browse the repository at this point in the history
)
  • Loading branch information
zexi authored Dec 15, 2023
1 parent 1a6c31d commit 6e9253b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pkg/cloudcommon/options/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pkg/cloudcommon/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 6e9253b

Please sign in to comment.