Chore: Flake8, isort and Black (#40)

This commit is contained in:
Stan Triepels
2022-11-16 01:45:40 +01:00
committed by GitHub
parent b73fea49b5
commit 3c0c32758d
39 changed files with 635 additions and 301 deletions
+2 -1
View File
@@ -39,7 +39,8 @@ class Sqs(Broker):
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"
"receive_message_wait_time_seconds is invalid. Reason: Must be >= 0"
" and <= 20"
)
params.update({"WaitTimeSeconds": wait_time_second})
+3 -2
View File
@@ -62,7 +62,7 @@ class ORM(Broker):
def dequeue(self):
tasks = self.get_connection().filter(key=self.list_key, lock__lt=_timeout())[
0 : Conf.BULK
0 : Conf.BULK # noqa: E203
]
if tasks:
task_list = []
@@ -73,7 +73,8 @@ class ORM(Broker):
.update(lock=timezone.now())
):
task_list.append((task.pk, task.payload))
# else don't process, as another cluster has been faster than us on that task
# else don't process, as another cluster has been faster than us on
# that task
return task_list
# empty queue, spare the cpu
sleep(Conf.POLL)