Skip to content

Conversation

@alecgibson
Copy link
Collaborator

At the moment, when calling:

queue.ping({resetTries: true})

The tries are reset as if the job hasn't been picked up, but the ack is left as-is.

This isn't necessarily problematic in the operation of the queue, but it does mean that the pinged job will still show up as in-flight.

This change adds an optional resetAck flag, which will also unset the ack, and means that the job can be marked as not in-flight, as if it has never been picked up.

At the moment, when calling:

```js
queue.ping({resetTries: true})
```

The tries are reset as if the job hasn't been picked up, but the `ack`
is left as-is.

This isn't necessarily problematic in the operation of the queue, but it
does mean that the pinged job will still show up as [in-flight][1].

This change adds an optional `resetAck` flag, which will also unset the
`ack`, and means that the job can be marked as not in-flight, as if it
has never been picked up.

[1]: https://github.com/reedsy/mongodb-queue/blob/6133fc9367f4fce719e36d8866841d531e956b6b/mongodb-queue.ts#L262
@alecgibson alecgibson merged commit 96cc6a1 into main Feb 18, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants