From f0a1f7084478f7899233021fbb4d4307c94dfead Mon Sep 17 00:00:00 2001 From: Rogger Valverde Date: Sun, 17 Dec 2023 22:58:00 -0500 Subject: [PATCH] feat(queue): add getRateLimitTtl method [python] (#2340) --- docs/gitbook/python/changelog.md | 3 --- python/bullmq/queue.py | 6 ++++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/gitbook/python/changelog.md b/docs/gitbook/python/changelog.md index bce5d8a1f4..2801c0770f 100644 --- a/docs/gitbook/python/changelog.md +++ b/docs/gitbook/python/changelog.md @@ -6,9 +6,6 @@ ### Feature * **job:** Add isFailed method [python] ([#2333](https://github.com/taskforcesh/bullmq/issues/2333)) ([`19bfccc`](https://github.com/taskforcesh/bullmq/commit/19bfccc2d7734b150a5fbb6ea720fcd9887c9dd3)) -### Fix -* **flows:** Update constructor and methods to match queue base ([#2324](https://github.com/taskforcesh/bullmq/issues/2324)) ([`d6c2064`](https://github.com/taskforcesh/bullmq/commit/d6c2064b1fdd88bd4cc61e049ce055ff620b0062)) - ## v1.21.0 (2023-12-14) ### Feature * **job:** Add isCompleted method [python] ([#2331](https://github.com/taskforcesh/bullmq/issues/2331)) ([`364f0c1`](https://github.com/taskforcesh/bullmq/commit/364f0c1f2d4247d2b24041ab9ece0e429110d454)) diff --git a/python/bullmq/queue.py b/python/bullmq/queue.py index 9e7f9eb353..941356f279 100644 --- a/python/bullmq/queue.py +++ b/python/bullmq/queue.py @@ -109,6 +109,12 @@ async def isPaused(self): paused_key_exists = await self.client.hexists(self.keys["meta"], "paused") return paused_key_exists == 1 + def getRateLimitTtl(self): + """ + Returns the time to live for a rate limited key in milliseconds. + """ + return self.client.pttl(self.keys["limiter"]) + async def obliterate(self, force: bool = False): """ Completely destroys the queue and all of its contents irreversibly.