Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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