mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-07 05:48:13 +08:00
Build improvements (#569)
* Black linting * Adding Black to dev dependencies and upping minimal python to 3.6.2 for compatibility * Updating packages * Removing pip-tools input and exporting requirements with poetry * Deleting old setup files and test runner * Trying 1.3.7 * Looser extras requirements to prevent conflicts * Sorted imports with isort * Added iSort to dev dependencies * Fixes localtime for naive setups
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import importlib
|
||||
from typing import Optional
|
||||
|
||||
from django.core.cache import caches, InvalidCacheBackendError
|
||||
from django.core.cache import InvalidCacheBackendError, caches
|
||||
|
||||
from django_q.conf import Conf
|
||||
|
||||
|
||||
@@ -38,7 +38,9 @@ class Sqs(Broker):
|
||||
if not isinstance(wait_time_second, int):
|
||||
raise ValueError("receive_message_wait_time_seconds should be int")
|
||||
if wait_time_second > 20:
|
||||
raise ValueError("receive_message_wait_time_seconds is invalid. Reason: Must be >= 0 and <= 20")
|
||||
raise ValueError(
|
||||
"receive_message_wait_time_seconds is invalid. Reason: Must be >= 0 and <= 20"
|
||||
)
|
||||
params.update({"WaitTimeSeconds": wait_time_second})
|
||||
|
||||
tasks = self.queue.receive_messages(**params)
|
||||
@@ -80,7 +82,7 @@ class Sqs(Broker):
|
||||
config["region_name"] = config["aws_region"]
|
||||
del config["aws_region"]
|
||||
|
||||
if 'receive_message_wait_time_seconds' in config:
|
||||
if "receive_message_wait_time_seconds" in config:
|
||||
del config["receive_message_wait_time_seconds"]
|
||||
|
||||
return Session(**config)
|
||||
|
||||
@@ -2,10 +2,11 @@ import random
|
||||
|
||||
# External
|
||||
import redis
|
||||
from redis import Redis
|
||||
|
||||
# Django
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from redis import Redis
|
||||
|
||||
from django_q.brokers import Broker
|
||||
from django_q.conf import Conf
|
||||
|
||||
|
||||
Reference in New Issue
Block a user