mirror of
https://github.com/d3vyce/taskiq-deduplication.git
synced 2026-08-04 19:14:07 +00:00
⬆ bump ruff from 0.15.17 to 0.16.0 (#89)
* ⬆ bump ruff from 0.15.17 to 0.16.0 Bumps [ruff](https://github.com/astral-sh/ruff) from 0.15.17 to 0.16.0. - [Release notes](https://github.com/astral-sh/ruff/releases) - [Changelog](https://github.com/astral-sh/ruff/blob/main/CHANGELOG.md) - [Commits](https://github.com/astral-sh/ruff/compare/0.15.17...0.16.0) --- updated-dependencies: - dependency-name: ruff dependency-version: 0.16.0 dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * fix: ruff warnings --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: d3vyce <nicolas.sudres@proton.me>
This commit is contained in:
+3
-2
@@ -34,9 +34,10 @@ broker = ListQueueBroker("redis://localhost:6379").with_middlewares(
|
||||
RedisDeduplicationMiddleware(redis_url="redis://localhost:6379"),
|
||||
)
|
||||
|
||||
|
||||
@broker.task
|
||||
async def send_report(user_id: int) -> None:
|
||||
...
|
||||
async def send_report(user_id: int) -> None: ...
|
||||
|
||||
|
||||
# First dispatch acquires the lock — succeeds.
|
||||
await send_report.kiq(user_id=42)
|
||||
|
||||
+6
-10
@@ -56,8 +56,8 @@ for worker crashes.
|
||||
```python
|
||||
RedisDeduplicationMiddleware(
|
||||
redis_url="redis://localhost:6379",
|
||||
default_ttl=60, # safety-net TTL; refreshed every ~20s while running
|
||||
heartbeat_interval=20, # optional; defaults to default_ttl / 3
|
||||
default_ttl=60, # safety-net TTL; refreshed every ~20s while running
|
||||
heartbeat_interval=20, # optional; defaults to default_ttl / 3
|
||||
)
|
||||
```
|
||||
|
||||
@@ -194,8 +194,7 @@ Labels can be set at the task level (applied to every call) or at call time.
|
||||
|
||||
```python
|
||||
@broker.task(deduplication_ttl=60)
|
||||
async def my_task(user_id: int) -> None:
|
||||
...
|
||||
async def my_task(user_id: int) -> None: ...
|
||||
```
|
||||
|
||||
### Call-level (kicker)
|
||||
@@ -232,8 +231,7 @@ the kwargs:
|
||||
|
||||
```python
|
||||
@broker.task(deduplication_key="send-welcome-email")
|
||||
async def send_welcome_email(user_id: int, locale: str) -> None:
|
||||
...
|
||||
async def send_welcome_email(user_id: int, locale: str) -> None: ...
|
||||
```
|
||||
|
||||
All calls to this task share a single lock, no matter what arguments are passed.
|
||||
@@ -246,8 +244,7 @@ duplicates:
|
||||
|
||||
```python
|
||||
@broker.task(deduplication_key_fields=["user_id"])
|
||||
async def send_welcome_email(user_id: int, locale: str) -> None:
|
||||
...
|
||||
async def send_welcome_email(user_id: int, locale: str) -> None: ...
|
||||
```
|
||||
|
||||
If a listed field is absent from a task's kwargs, it is dropped from the
|
||||
@@ -262,6 +259,5 @@ A warning is logged if the task is called with positional arguments anyway.
|
||||
|
||||
```python
|
||||
@broker.task(deduplication=False)
|
||||
async def always_run(payload: str) -> None:
|
||||
...
|
||||
async def always_run(payload: str) -> None: ...
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user