Skip to content

Commit 2ffe388

Browse files
committed
feat: align with latest SAQ features and clean up dead code
1 parent d3a5582 commit 2ffe388

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

litestar_saq/config.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,6 @@ class PostgresQueueOptions(TypedDict, total=False):
227227
min_size: NotRequired[int]
228228
max_size: NotRequired[int]
229229
saq_lock_keyspace: NotRequired[int]
230-
job_lock_keyspace: NotRequired[int]
231-
job_lock_sweep: NotRequired[bool]
232230
priorities: NotRequired["tuple[int, int]"]
233231
swept_error_message: NotRequired[str]
234232
manage_pool_lifecycle: NotRequired[bool]

litestar_saq/exceptions.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,3 @@ class ImproperConfigurationError(LitestarSaqError):
77
88
This exception is raised only when a module depends on a dependency that has not been installed.
99
"""
10-
11-
12-
class BackgroundTaskError(Exception):
13-
"""Base class for `Task` related exceptions."""

tests/test_config.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,18 @@ def fake_import_module(path: str) -> types.ModuleType:
5050
config.broker_instance = DummyAsyncRedis() # type: ignore[assignment]
5151

5252
assert config.broker_type == "redis"
53+
54+
55+
def test_postgres_queue_options_does_not_contain_deprecated_options() -> None:
56+
"""Verify that deprecated postgres lock options are not in PostgresQueueOptions."""
57+
from litestar_saq.config import PostgresQueueOptions
58+
59+
assert "job_lock_keyspace" not in PostgresQueueOptions.__annotations__
60+
assert "job_lock_sweep" not in PostgresQueueOptions.__annotations__
61+
62+
63+
def test_background_task_error_not_importable() -> None:
64+
"""Verify that BackgroundTaskError has been removed and cannot be imported."""
65+
import litestar_saq.exceptions
66+
67+
assert not hasattr(litestar_saq.exceptions, "BackgroundTaskError")

0 commit comments

Comments
 (0)