diff options
author | Valery Piashchynski <[email protected]> | 2021-07-23 08:11:48 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-07-23 08:11:48 +0300 |
commit | 6764d0f9e3b8fe34598b425fadf67a043872a604 (patch) | |
tree | 1862490366439ab2aebd31fe11a9ffe48ad04cef | |
parent | 3f45d2c008c95daa923fef0c4c9022b2be462971 (diff) |
Remove time.Now() from beanstalk tube declaration
Signed-off-by: Valery Piashchynski <[email protected]>
-rw-r--r-- | pkg/events/jobs_events.go | 5 | ||||
-rw-r--r-- | plugins/jobs/drivers/beanstalk/config.go | 2 | ||||
-rw-r--r-- | plugins/jobs/drivers/beanstalk/consumer.go | 2 | ||||
-rw-r--r-- | tests/plugins/jobs/jobs_beanstalk_test.go | 2 |
4 files changed, 3 insertions, 8 deletions
diff --git a/pkg/events/jobs_events.go b/pkg/events/jobs_events.go index 9a871956..c0ee733a 100644 --- a/pkg/events/jobs_events.go +++ b/pkg/events/jobs_events.go @@ -20,9 +20,6 @@ const ( // EventJobError thrown on all job related errors. See JobError as context. EventJobError - // EventPipeRun when pipeline pipelines has been requested. - EventPipeRun - // EventInitialized when pipeline has been initialized, but not started EventInitialized @@ -56,8 +53,6 @@ func (ev J) String() string { return "EventJobOK" case EventJobError: return "EventJobError" - case EventPipeRun: - return "EventPipeRun" case EventInitialized: return "EventInitialized" case EventPipeActive: diff --git a/plugins/jobs/drivers/beanstalk/config.go b/plugins/jobs/drivers/beanstalk/config.go index c1059d1e..f0012362 100644 --- a/plugins/jobs/drivers/beanstalk/config.go +++ b/plugins/jobs/drivers/beanstalk/config.go @@ -32,7 +32,7 @@ type Config struct { func (c *Config) InitDefault() { if c.Tube == "" { - c.Tube = "default-" + time.Now().String() + c.Tube = "default" } if c.ReserveTimeout == 0 { diff --git a/plugins/jobs/drivers/beanstalk/consumer.go b/plugins/jobs/drivers/beanstalk/consumer.go index 8bd11a58..dec54426 100644 --- a/plugins/jobs/drivers/beanstalk/consumer.go +++ b/plugins/jobs/drivers/beanstalk/consumer.go @@ -206,7 +206,7 @@ func (j *JobConsumer) Run(p *pipeline.Pipeline) error { go j.listen() j.eh.Push(events.JobEvent{ - Event: events.EventPipeRun, + Event: events.EventPipeActive, Driver: pipe.Driver(), Pipeline: pipe.Name(), Start: time.Now(), diff --git a/tests/plugins/jobs/jobs_beanstalk_test.go b/tests/plugins/jobs/jobs_beanstalk_test.go index d3e0dd2a..b36b4977 100644 --- a/tests/plugins/jobs/jobs_beanstalk_test.go +++ b/tests/plugins/jobs/jobs_beanstalk_test.go @@ -224,7 +224,7 @@ func declareBeanstalkPipe(t *testing.T) { pipe := &jobsv1beta.DeclareRequest{Pipeline: map[string]string{ "driver": "beanstalk", "name": "test-3", - "tube": "default-" + time.Now().String(), + "tube": "default", "reserve_timeout": "1", "priority": "3", "tube_priority": "10", |