diff --git a/packages/django-dramatiq-postgres/django_dramatiq_postgres/broker.py b/packages/django-dramatiq-postgres/django_dramatiq_postgres/broker.py index 459a266a277b..47b2d20602c4 100644 --- a/packages/django-dramatiq-postgres/django_dramatiq_postgres/broker.py +++ b/packages/django-dramatiq-postgres/django_dramatiq_postgres/broker.py @@ -1,11 +1,9 @@ import functools -import logging import time from collections.abc import Callable, Iterable from datetime import UTC, datetime, timedelta from typing import Any, ParamSpec, TypeVar, cast -import tenacity from django.core.exceptions import ImproperlyConfigured from django.db import ( DEFAULT_DB_ALIAS, @@ -136,15 +134,6 @@ def model_defaults(self, message: Message[Any]) -> dict[str, Any]: "eta": eta, } - @tenacity.retry( - retry=tenacity.retry_if_exception_type(ConnectionError), - reraise=True, - wait=tenacity.wait_random_exponential(multiplier=1, max=5), - stop=tenacity.stop_after_attempt(3), - before_sleep=tenacity.before_sleep_log( - cast(logging.Logger, logger), logging.INFO, exc_info=True - ), - ) @raise_connection_error def enqueue(self, message: Message[Any], *, delay: int | None = None) -> Message[Any]: queue_name = q_name(message.queue_name) # type: ignore[no-untyped-call] diff --git a/packages/django-dramatiq-postgres/pyproject.toml b/packages/django-dramatiq-postgres/pyproject.toml index 96c4376a4754..84d463c3d4cc 100644 --- a/packages/django-dramatiq-postgres/pyproject.toml +++ b/packages/django-dramatiq-postgres/pyproject.toml @@ -37,7 +37,6 @@ dependencies = [ "django-pglock >=1.7,<2", "django-pgtrigger >=4,<5", "dramatiq[watch] >=1.17,<1.18", - "tenacity >=9,<10", "structlog >=25,<26", ] diff --git a/uv.lock b/uv.lock index 34a1917533f9..c36edce73c32 100644 --- a/uv.lock +++ b/uv.lock @@ -1118,7 +1118,6 @@ dependencies = [ { name = "django-pgtrigger" }, { name = "dramatiq", extra = ["watch"] }, { name = "structlog" }, - { name = "tenacity" }, ] [package.metadata] @@ -1129,7 +1128,6 @@ requires-dist = [ { name = "django-pgtrigger", specifier = ">=4,<5" }, { name = "dramatiq", extras = ["watch"], specifier = ">=1.17,<1.18" }, { name = "structlog", specifier = ">=25,<26" }, - { name = "tenacity", specifier = ">=9,<10" }, ] [[package]] @@ -3503,15 +3501,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f4/ac/31ba87a959b19e640ebc18851438b82b5b66cef02ad31da7468d1d8bd625/swagger_spec_validator-3.0.4-py2.py3-none-any.whl", hash = "sha256:1a2a4f4f7076479ae7835d892dd53952ccca9414efa172c440c775cf0ac01f48", size = 28473, upload-time = "2024-06-27T17:43:00.546Z" }, ] -[[package]] -name = "tenacity" -version = "9.1.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/0a/d4/2b0cd0fe285e14b36db076e78c93766ff1d529d70408bd1d2a5a84f1d929/tenacity-9.1.2.tar.gz", hash = "sha256:1169d376c297e7de388d18b4481760d478b0e99a777cad3a9c86e556f4b697cb", size = 48036, upload-time = "2025-04-02T08:25:09.966Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e5/30/643397144bfbfec6f6ef821f36f33e57d35946c44a2352d3c9f0ae847619/tenacity-9.1.2-py3-none-any.whl", hash = "sha256:f77bf36710d8b73a50b2dd155c97b870017ad21afe6ab300326b0371b3b05138", size = 28248, upload-time = "2025-04-02T08:25:07.678Z" }, -] - [[package]] name = "trio" version = "0.32.0"