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():
try:
inbox, message, instance = self.queue.get(block=True, timeout=0.25)
await client.post(inbox, message, instance)
inbox, message, instance = self.queue.get(block=True, timeout=0.1)
asyncio.create_task(client.post(inbox, message, instance))
except Empty:
pass
await asyncio.sleep(0)
# make sure an exception doesn't bring down the worker
except Exception: