diff --git a/cmd/src/campaigns_common.go b/cmd/src/campaigns_common.go index d0b6eab5a4..423baa2948 100644 --- a/cmd/src/campaigns_common.go +++ b/cmd/src/campaigns_common.go @@ -186,7 +186,7 @@ func campaignsExecute(ctx context.Context, out *output.Output, svc *campaigns.Se } else { opts.Parallelism = flags.parallelism } - executor := svc.NewExecutor(opts, nil) + executor := svc.NewExecutor(opts) if errs != nil { return "", "", errs diff --git a/internal/campaigns/executor.go b/internal/campaigns/executor.go index 1c45b2d181..ff3effc94b 100644 --- a/internal/campaigns/executor.go +++ b/internal/campaigns/executor.go @@ -66,8 +66,6 @@ type TaskStatus struct { Err error } -type ExecutorUpdateCallback func(*Task, TaskStatus) - type executor struct { ExecutorOpts @@ -81,13 +79,11 @@ type executor struct { par *parallel.Run doneEnqueuing chan struct{} - update ExecutorUpdateCallback - specs []*ChangesetSpec specsMu sync.Mutex } -func newExecutor(opts ExecutorOpts, client api.Client, update ExecutorUpdateCallback) *executor { +func newExecutor(opts ExecutorOpts, client api.Client) *executor { return &executor{ ExecutorOpts: opts, cache: opts.Cache, @@ -97,7 +93,6 @@ func newExecutor(opts ExecutorOpts, client api.Client, update ExecutorUpdateCall logger: NewLogManager(opts.TempDir, opts.KeepLogs), tempDir: opts.TempDir, par: parallel.NewRun(opts.Parallelism), - update: update, } } @@ -272,9 +267,6 @@ func (x *executor) do(ctx context.Context, task *Task) (err error) { func (x *executor) updateTaskStatus(task *Task, status *TaskStatus) { x.tasks.Store(task, status) - if x.update != nil { - x.update(task, *status) - } } type errTimeoutReached struct{ timeout time.Duration } diff --git a/internal/campaigns/executor_test.go b/internal/campaigns/executor_test.go index 3a69d00120..dee7433fc3 100644 --- a/internal/campaigns/executor_test.go +++ b/internal/campaigns/executor_test.go @@ -121,7 +121,7 @@ func TestExecutor_Integration(t *testing.T) { opts.Timeout = 5 * time.Second } - executor := newExecutor(opts, client, nil) + executor := newExecutor(opts, client) template := &ChangesetTemplate{} for _, r := range tc.repos { diff --git a/internal/campaigns/service.go b/internal/campaigns/service.go index 910ea3e036..83e1684c50 100644 --- a/internal/campaigns/service.go +++ b/internal/campaigns/service.go @@ -150,8 +150,8 @@ type ExecutorOpts struct { CacheDir string } -func (svc *Service) NewExecutor(opts ExecutorOpts, update ExecutorUpdateCallback) Executor { - return newExecutor(opts, svc.client, update) +func (svc *Service) NewExecutor(opts ExecutorOpts) Executor { + return newExecutor(opts, svc.client) } func (svc *Service) NewWorkspaceCreator(dir string, cleanArchives bool) *WorkspaceCreator {