Skip to content

Commit 4dafddc

Browse files
committed
redis: Remove requeue_{deadline,interval} arguments
1 parent 3a94a77 commit 4dafddc

File tree

3 files changed

+4
-19
lines changed

3 files changed

+4
-19
lines changed

docs/source/changelog.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,14 @@ These are changes that while technically breaking, we believe are unlikely to ef
4747
This is only relevant if you have written custom code (such as a custom Rate Limiter)
4848
that uses a ``RateLimiterBackend``.
4949
(`#741`_, `#772`_, `@mikeroll`_)
50+
* The long-deprecated ``requeue_{deadline,interval}`` arguments of |RedisBroker| have been removed.
51+
(`#782`_, `@mikeroll`_)
5052

5153
.. _#766: https://github.com/Bogdanp/dramatiq/pull/766
5254
.. _PEP-735: https://peps.python.org/pep-0735/
5355
.. _#741: https://github.com/Bogdanp/dramatiq/issues/741
5456
.. _#772: https://github.com/Bogdanp/dramatiq/pull/772
57+
.. _#782: https://github.com/Bogdanp/dramatiq/pull/782
5558
.. _@mikeroll: https://github.com/mikeroll
5659

5760
Fixed

dramatiq/brokers/redis.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import glob
2121
import random
2222
import time
23-
import warnings
2423
from os import path
2524
from threading import Lock
2625
from typing import Optional
@@ -82,9 +81,7 @@ class RedisBroker(Broker):
8281
offline.
8382
dead_message_ttl(int): The amount of time (in ms) that
8483
dead-lettered messages are kept in Redis for.
85-
requeue_deadline(int): Deprecated. Does nothing.
86-
requeue_interval(int): Deprecated. Does nothing.
87-
client(redis.StrictRedis): A redis client to use.
84+
client(redis.Redis): A redis client to use.
8885
**parameters: Connection parameters are passed directly
8986
to :class:`redis.Redis`.
9087
@@ -100,8 +97,6 @@ def __init__(
10097
maintenance_chance=DEFAULT_MAINTENANCE_CHANCE,
10198
heartbeat_timeout=DEFAULT_HEARTBEAT_TIMEOUT,
10299
dead_message_ttl=DEFAULT_DEAD_MESSAGE_TTL,
103-
requeue_deadline=None,
104-
requeue_interval=None,
105100
client=None,
106101
**parameters,
107102
):
@@ -110,10 +105,6 @@ def __init__(
110105
if url:
111106
parameters["connection_pool"] = redis.ConnectionPool.from_url(url)
112107

113-
if requeue_deadline or requeue_interval:
114-
message = "requeue_{deadline,interval} have been deprecated and no longer do anything"
115-
warnings.warn(message, DeprecationWarning, stacklevel=2)
116-
117108
self.broker_id = str(uuid4())
118109
self.namespace = namespace
119110
self.maintenance_chance = maintenance_chance

tests/test_redis.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -332,15 +332,6 @@ def test_redis_broker_can_connect_via_client():
332332
assert broker.client is client
333333

334334

335-
def test_redis_broker_warns_about_deprecated_parameters():
336-
# When I pass deprecated params to RedisBroker
337-
# Then it should warn me that those params do nothing
338-
with pytest.warns(DeprecationWarning) as record:
339-
RedisBroker(requeue_deadline=1000)
340-
341-
assert str(record[0].message) == "requeue_{deadline,interval} have been deprecated and no longer do anything"
342-
343-
344335
def test_redis_broker_raises_attribute_error_when_given_an_invalid_attribute(redis_broker):
345336
# Given that I have a Redis broker
346337
# When I try to access an attribute that doesn't exist

0 commit comments

Comments
 (0)