From 587b9483d77f55dd9bc2303d46812902ac154889 Mon Sep 17 00:00:00 2001 From: Izalia Mae Date: Sat, 30 Mar 2024 05:33:06 -0400 Subject: [PATCH] create a task instead of waiting for client posts in workers --- relay/application.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/relay/application.py b/relay/application.py index aba9bc7..e48c292 100644 --- a/relay/application.py +++ b/relay/application.py @@ -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: