summaryrefslogtreecommitdiff
path: root/plugins/jobs/drivers/beanstalk/redial.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/jobs/drivers/beanstalk/redial.go')
-rw-r--r--plugins/jobs/drivers/beanstalk/redial.go41
1 files changed, 0 insertions, 41 deletions
diff --git a/plugins/jobs/drivers/beanstalk/redial.go b/plugins/jobs/drivers/beanstalk/redial.go
deleted file mode 100644
index 784337ad..00000000
--- a/plugins/jobs/drivers/beanstalk/redial.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package beanstalk
-
-import (
- "sync/atomic"
- "time"
-
- "github.com/cenkalti/backoff/v4"
-)
-
-func (j *JobConsumer) redial() {
- for range j.reconnectCh {
- // backoff here
- expb := backoff.NewExponentialBackOff()
- // set the retry timeout (minutes)
- expb.MaxElapsedTime = time.Minute * 5
-
- op := func() error {
- err := j.pool.Redial()
- if err != nil {
- return err
- }
-
- j.log.Info("beanstalk redial was successful")
- // reassign a pool
- return nil
- }
-
- retryErr := backoff.Retry(op, expb)
- if retryErr != nil {
- j.log.Error("beanstalk backoff failed", "error", retryErr)
- continue
- }
-
- // restart listener
- if atomic.LoadUint32(&j.listeners) == 1 {
- // stop previous listener
- j.stopCh <- struct{}{}
- go j.listen()
- }
- }
-}