summaryrefslogtreecommitdiff
path: root/plugins/jobs/drivers/amqp/item.go
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-08-12 09:38:47 +0300
committerValery Piashchynski <[email protected]>2021-08-12 09:38:47 +0300
commitbf2f7167ae49ecac981c7c18a9b9b496fd0a514c (patch)
tree9c5c11ab7984df0775d62553808fc95d395e20d5 /plugins/jobs/drivers/amqp/item.go
parent2d460062c97f9ad1e793831c54ae4d177dea83e8 (diff)
Made QoS production like
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'plugins/jobs/drivers/amqp/item.go')
-rw-r--r--plugins/jobs/drivers/amqp/item.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/jobs/drivers/amqp/item.go b/plugins/jobs/drivers/amqp/item.go
index f252acd8..9b9625b0 100644
--- a/plugins/jobs/drivers/amqp/item.go
+++ b/plugins/jobs/drivers/amqp/item.go
@@ -54,6 +54,7 @@ type Options struct {
// This method must not be used to select or requeue messages the client wishes not to handle, rather it is to inform the server that the client is incapable of handling this message at this time
nack func(multiply bool, requeue bool) error
+ // requeueFn used as a pointer to the push function
requeueFn func(context.Context, *Item) error
multipleAsk bool
@@ -123,9 +124,9 @@ func (i *Item) Requeue(headers map[string][]string, delay int64) error {
err := i.Options.requeueFn(context.Background(), i)
if err != nil {
- errAck := i.Options.nack(false, true)
- if errAck != nil {
- return fmt.Errorf("requeue error: %v\nack error: %v", err, errAck)
+ errNack := i.Options.nack(false, true)
+ if errNack != nil {
+ return fmt.Errorf("requeue error: %v\nack error: %v", err, errNack)
}
return err