fix(cloudevent): allow disable sync cloudevent (#14448)

This commit is contained in:
屈轩
2022-06-14 00:47:03 +08:00
committed by GitHub
parent 9cc78f1463
commit f2070dc854
2 changed files with 5 additions and 0 deletions
+3
View File
@@ -256,6 +256,9 @@ func (manager *SCloudproviderManager) syncCloudeventTask(ctx context.Context, us
}
func (manager *SCloudproviderManager) SyncCloudeventTask(ctx context.Context, userCred mcclient.TokenCredential, isStart bool) {
if options.Options.DisableSyncCloudEvent {
return
}
err := manager.syncCloudeventTask(ctx, userCred)
if err != nil {
log.Errorf("syncCloudeventTask error: %v", err)
+2
View File
@@ -23,6 +23,8 @@ type CloudeventOptions struct {
CloudproviderSyncIntervalMinutes int `help:"frequency to sync region cloudprovider task" default:"15"`
CloudeventSyncIntervalHours int `help:"frequency to sync cloud event task" default:"1"`
DisableSyncCloudEvent bool `help:"disable sync cloudevent" default:"false"`
SyncWithReadEvent bool `help:"sync read operation events" default:"false"`
OneSyncForHours int `help:"Onece sync for hours" default:"1"`
}