diff options
-rw-r--r-- | plugins/jobs/drivers/ephemeral/consumer.go | 14 | ||||
-rw-r--r-- | plugins/jobs/plugin.go | 10 | ||||
-rw-r--r-- | tests/plugins/jobs/jobs_plugin_test.go | 1 |
3 files changed, 3 insertions, 22 deletions
diff --git a/plugins/jobs/drivers/ephemeral/consumer.go b/plugins/jobs/drivers/ephemeral/consumer.go index 45ee8083..cd08ca7a 100644 --- a/plugins/jobs/drivers/ephemeral/consumer.go +++ b/plugins/jobs/drivers/ephemeral/consumer.go @@ -152,7 +152,7 @@ func (j *JobBroker) Pause(pipeline string) { func (j *JobBroker) Resume(pipeline string) { if q, ok := j.pipeline.Load(pipeline); ok { if q == false { - // mark pipeline as turned off + // mark pipeline as turned on j.pipeline.Store(pipeline, true) } } @@ -165,18 +165,6 @@ func (j *JobBroker) Resume(pipeline string) { }) } -func (j *JobBroker) List() []string { - out := make([]string, 0, 2) - - j.pipeline.Range(func(key, value interface{}) bool { - pipe := key.(string) - out = append(out, pipe) - return true - }) - - return out -} - // Run is no-op for the ephemeral func (j *JobBroker) Run(_ *pipeline.Pipeline) error { return nil diff --git a/plugins/jobs/plugin.go b/plugins/jobs/plugin.go index ce51df21..f71c2718 100644 --- a/plugins/jobs/plugin.go +++ b/plugins/jobs/plugin.go @@ -142,20 +142,12 @@ func (p *Plugin) Serve() chan error { //nolint:gocognit errCh <- errors.E(op, err) return false } - - p.events.Push(events.JobEvent{ - Event: events.EventPipeRun, - Pipeline: pipe.Name(), - Driver: pipe.Driver(), - Start: t, - Elapsed: t.Sub(t), - }) - return true } return true } + p.events.Push(events.JobEvent{ Event: events.EventDriverReady, Pipeline: pipe.Name(), diff --git a/tests/plugins/jobs/jobs_plugin_test.go b/tests/plugins/jobs/jobs_plugin_test.go index f8a5c3e7..9a13435b 100644 --- a/tests/plugins/jobs/jobs_plugin_test.go +++ b/tests/plugins/jobs/jobs_plugin_test.go @@ -123,6 +123,7 @@ func TestJobsInit(t *testing.T) { mockLogger.EXPECT().Info("driver ready", "pipeline", "test-2", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) mockLogger.EXPECT().Info("driver ready", "pipeline", "test-3", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) + mockLogger.EXPECT().Info("pipeline started", "pipeline", "test-local-2", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) mockLogger.EXPECT().Info("pipeline started", "pipeline", "test-1", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) mockLogger.EXPECT().Info("pipeline started", "pipeline", "test-2-amqp", "start", gomock.Any(), "elapsed", gomock.Any()).Times(1) |