diff options
author | Valery Piashchynski <[email protected]> | 2021-08-11 13:42:33 +0300 |
---|---|---|
committer | Valery Piashchynski <[email protected]> | 2021-08-11 13:42:33 +0300 |
commit | de37ed3ae8d08a50d9ffe088c1d58d9dffdf7c9b (patch) | |
tree | 712a47dde5941dd53c9f12ae41e62384df57b4b4 /plugins/jobs/drivers/beanstalk/item.go | |
parent | 2924f4b4daa3c53408a036583dcc39f6de805e2b (diff) |
Add headers support to the jobs protocol
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/drivers/beanstalk/item.go')
-rw-r--r-- | plugins/jobs/drivers/beanstalk/item.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/jobs/drivers/beanstalk/item.go b/plugins/jobs/drivers/beanstalk/item.go index 91dbf41c..50c54b12 100644 --- a/plugins/jobs/drivers/beanstalk/item.go +++ b/plugins/jobs/drivers/beanstalk/item.go @@ -111,9 +111,10 @@ func (i *Item) Nack() error { return i.Options.conn.Delete(i.Options.id) } -func (i *Item) Requeue(delay int64) error { +func (i *Item) Requeue(headers map[string][]string, delay int64) error { // overwrite the delay i.Options.Delay = delay + i.Headers = headers select { case i.Options.requeueCh <- i: return nil @@ -122,6 +123,7 @@ func (i *Item) Requeue(delay int64) error { } } + func fromJob(job *job.Job) *Item { return &Item{ Job: job.Job, |