create a task instead of waiting for client posts in workers

This commit is contained in:
Izalia Mae 2024-03-30 05:33:06 -04:00
parent beb9d9c3e5
commit 587b9483d7

View file

@ -315,11 +315,11 @@ class PushWorker(multiprocessing.Process):
while not self.shutdown.is_set(): while not self.shutdown.is_set():
try: try:
inbox, message, instance = self.queue.get(block=True, timeout=0.25) inbox, message, instance = self.queue.get(block=True, timeout=0.1)
await client.post(inbox, message, instance) asyncio.create_task(client.post(inbox, message, instance))
except Empty: except Empty:
pass await asyncio.sleep(0)
# make sure an exception doesn't bring down the worker # make sure an exception doesn't bring down the worker
except Exception: except Exception: