Skip to content

Commit

Permalink
[#71]: fix: ask->ack typo
Browse files Browse the repository at this point in the history
  • Loading branch information
rustatian authored May 20, 2023
2 parents 8f628c7 + 2cacf9e commit dac4ca8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions amqpjobs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (
durable string = "durable"
deleteOnStop string = "delete_queue_on_stop"
priority string = "priority"
multipleAsk string = "multiple_ask"
multipleAck string = "multiple_ack"
requeueOnFail string = "requeue_on_fail"

// new in 2.12
Expand Down Expand Up @@ -75,7 +75,7 @@ type config struct {
Exclusive bool `mapstructure:"exclusive"`
Durable bool `mapstructure:"durable"`
DeleteQueueOnStop bool `mapstructure:"delete_queue_on_stop"`
MultipleAck bool `mapstructure:"multiple_ask"`
MultipleAck bool `mapstructure:"multiple_ack"`
RequeueOnFail bool `mapstructure:"requeue_on_fail"`

// new in 2.12.1
Expand Down
2 changes: 1 addition & 1 deletion amqpjobs/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ func FromPipeline(tracer *sdktrace.TracerProvider, pipeline jobs.Pipeline, log *
durable: pipeline.Bool(durable, false),
deleteQueueOnStop: pipeline.Bool(deleteOnStop, false),
exclusive: pipeline.Bool(exclusive, false),
multipleAck: pipeline.Bool(multipleAsk, false),
multipleAck: pipeline.Bool(multipleAck, false),
requeueOnFail: pipeline.Bool(requeueOnFail, false),

// new in 2.12
Expand Down
8 changes: 4 additions & 4 deletions amqpjobs/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ type Options struct {

// delayed jobs TODO(rustatian): figure out how to get stats from the DLX
delayed *int64
multipleAsk bool
multipleAck bool
requeue bool
}

Expand Down Expand Up @@ -121,7 +121,7 @@ func (i *Item) Ack() error {
if i.Options.Delay > 0 {
atomic.AddInt64(i.Options.delayed, ^int64(0))
}
return i.Options.ack(i.Options.multipleAsk)
return i.Options.ack(i.Options.multipleAck)
}

func (i *Item) Nack() error {
Expand Down Expand Up @@ -195,7 +195,7 @@ func (d *Driver) fromDelivery(deliv amqp.Delivery) (*Item, error) {
nack: deliv.Nack,
requeueFn: d.handleItem,
delayed: d.delayed,
multipleAsk: false,
multipleAck: false,
requeue: false,
},
}, nil
Expand Down Expand Up @@ -272,7 +272,7 @@ func (d *Driver) unpack(deliv amqp.Delivery) (*Item, error) {
item := &Item{
Payload: bytesToStr(deliv.Body),
Options: &Options{
multipleAsk: d.multipleAck,
multipleAck: d.multipleAck,
requeue: d.requeueOnFail,
requeueFn: d.handleItem,
Queue: d.queue,
Expand Down

0 comments on commit dac4ca8

Please sign in to comment.