summaryrefslogtreecommitdiff
path: root/plugins/beanstalk/listen.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/beanstalk/listen.go')
-rw-r--r--plugins/beanstalk/listen.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/plugins/beanstalk/listen.go b/plugins/beanstalk/listen.go
deleted file mode 100644
index 6bb159ea..00000000
--- a/plugins/beanstalk/listen.go
+++ /dev/null
@@ -1,39 +0,0 @@
-package beanstalk
-
-import (
- "github.com/beanstalkd/go-beanstalk"
-)
-
-func (j *consumer) listen() {
- for {
- select {
- case <-j.stopCh:
- j.log.Warn("beanstalk listener stopped")
- return
- default:
- id, body, err := j.pool.Reserve(j.reserveTimeout)
- if err != nil {
- if errB, ok := err.(beanstalk.ConnError); ok {
- switch errB.Err { //nolint:gocritic
- case beanstalk.ErrTimeout:
- j.log.Info("beanstalk reserve timeout", "warn", errB.Op)
- continue
- }
- }
- // in case of other error - continue
- j.log.Error("beanstalk reserve", "error", err)
- continue
- }
-
- item := &Item{}
- err = j.unpack(id, body, item)
- if err != nil {
- j.log.Error("beanstalk unpack item", "error", err)
- continue
- }
-
- // insert job into the priority queue
- j.pq.Insert(item)
- }
- }
-}