Move worker, scheduler, pusher and monitor to separate files (#100)

This commit is contained in:
Stan Triepels
2023-07-02 02:47:05 +02:00
committed by GitHub
parent f8501bfb4c
commit 7fb7fca176
23 changed files with 1127 additions and 1004 deletions
+6 -2
View File
@@ -37,7 +37,9 @@ class ORM(Broker):
def lock_size(self) -> int:
return (
self.get_connection().filter(key=self.list_key, lock__gt=timezone.now()).count()
self.get_connection()
.filter(key=self.list_key, lock__gt=timezone.now())
.count()
)
def purge_queue(self):
@@ -62,7 +64,9 @@ class ORM(Broker):
return package.pk
def dequeue(self):
tasks = self.get_connection().filter(key=self.list_key, lock__lt=timezone.now())[
tasks = self.get_connection().filter(
key=self.list_key, lock__lt=timezone.now()
)[
0 : Conf.BULK # noqa: E203
]
if tasks: