Skip to content

Commit

Permalink
docs(job): clarify per-queue scoping of Job Ids
Browse files Browse the repository at this point in the history
  • Loading branch information
clemens committed Oct 24, 2024
1 parent 569cbc4 commit c3864cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/gitbook/guide/jobs/job-ids.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All jobs in BullMQ need to have a unique job id. This id is used to construct a

By default, job ids are generated automatically as an increasing counter, however it is also possible to specify a _custom id_.

{% hint style="info" %}
The uniqueness requirement is scoped by queue, i.e. you can have the same job id in different queues without any issues. The counter for automatically generated ids is also scoped by queue.
{% endhint %}

The main reason to be able to specify a custom id is in cases when you want to avoid duplicated jobs. Since ids must be unique, if you add a job with an existing id then that job will just be ignored and not added to the queue at all.

{% hint style="danger" %}
Expand Down

0 comments on commit c3864cd

Please sign in to comment.