Skip to content

Commit

Permalink
style: assume py38 on ruff config
Browse files Browse the repository at this point in the history
  • Loading branch information
allisson committed Feb 23, 2024
1 parent 335eb83 commit 9097bed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
line-length = 110
indent-width = 4

# Assume Python 3.12.
target-version = "py312"
# Assume Python 3.8.
target-version = "py38"

# Enable automatic fixes.
fix = true
Expand Down
9 changes: 4 additions & 5 deletions sqsx/queue.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import logging
import signal
import time
from collections.abc import Callable
from concurrent.futures import ThreadPoolExecutor, wait
from typing import Any
from typing import Any, Callable, Dict, Optional

from pydantic import BaseModel, Field, PrivateAttr

Expand Down Expand Up @@ -62,8 +61,8 @@ def _message_ack(self, sqs_message: dict) -> None:
def _message_nack(
self,
sqs_message: dict,
min_backoff_seconds: int | None = None,
max_backoff_seconds: int | None = None,
min_backoff_seconds: Optional[int] = None,
max_backoff_seconds: Optional[int] = None,
) -> None:
min_backoff_seconds = min_backoff_seconds if min_backoff_seconds else self.min_backoff_seconds
max_backoff_seconds = max_backoff_seconds if max_backoff_seconds else self.max_backoff_seconds
Expand All @@ -80,7 +79,7 @@ class Queue(BaseModel, BaseQueueMixin):
sqs_client: Any
min_backoff_seconds: int = Field(default=30)
max_backoff_seconds: int = Field(default=900)
_handlers: dict[str, Callable] = PrivateAttr(default={})
_handlers: Dict[str, Callable] = PrivateAttr(default={})
_should_consume_tasks_stop: bool = PrivateAttr(default=False)

def add_task(self, task_name: str, **task_kwargs) -> dict:
Expand Down

0 comments on commit 9097bed

Please sign in to comment.