mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-12-23 03:31:07 +00:00
create a task instead of waiting for client posts in workers
This commit is contained in:
parent
beb9d9c3e5
commit
587b9483d7
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue