From c948c8aa2861f0352a915b1279d40a5de518230d Mon Sep 17 00:00:00 2001 From: roggervalf Date: Sat, 23 Sep 2023 00:27:01 -0500 Subject: [PATCH] docs(rate-limit): add missing limiter options in examples ref #2193 --- docs/gitbook/guide/rate-limiting.md | 8 ++++++++ docs/gitbook/patterns/stop-retrying-jobs.md | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/docs/gitbook/guide/rate-limiting.md b/docs/gitbook/guide/rate-limiting.md index 20b03d20f1..7bb0080285 100644 --- a/docs/gitbook/guide/rate-limiting.md +++ b/docs/gitbook/guide/rate-limiting.md @@ -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. diff --git a/docs/gitbook/patterns/stop-retrying-jobs.md b/docs/gitbook/patterns/stop-retrying-jobs.md index c64248347f..584409c466 100644 --- a/docs/gitbook/patterns/stop-retrying-jobs.md +++ b/docs/gitbook/patterns/stop-retrying-jobs.md @@ -46,6 +46,10 @@ const worker = new Worker( }, { connection, + limiter: { + max: 1, + duration: 500, + }, }, ); ```