diff --git a/controller/starter.go b/controller/starter.go index 31cc069d..2c488a17 100644 --- a/controller/starter.go +++ b/controller/starter.go @@ -11,6 +11,13 @@ type Starter interface { Start(ctx context.Context, threadiness int) error } +func SyncThenSync(ctx context.Context, threadiness int, starters ...Starter) error { + if err := Sync(ctx, starters...); err != nil { + return err + } + return Start(ctx, threadiness, starters...) +} + func Sync(ctx context.Context, starters ...Starter) error { eg, _ := errgroup.WithContext(ctx) for _, starter := range starters {