Skip to content

Commit

Permalink
docs(rate-limit): add missing limiter options in examples ref #2193
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Sep 23, 2023
1 parent 9d78a99 commit c948c8a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/gitbook/guide/rate-limiting.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,18 @@ const worker = new Worker(
},
{
connection,
limiter: {
max: 1,
duration: 500,
},
},
);
```

{% hint style="warning" %}
Don't forget to pass limiter options into your worker's options as _limiter.max_ is used to determine if we need to execute the rate limit validation.
{% endhint %}

### Get Queue Rate Limit Ttl

Sometimes is useful to know if our queue is rate limited.
Expand Down
4 changes: 4 additions & 0 deletions docs/gitbook/patterns/stop-retrying-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ const worker = new Worker(
},
{
connection,
limiter: {
max: 1,
duration: 500,
},
},
);
```
Expand Down

0 comments on commit c948c8a

Please sign in to comment.