mirror of
https://git.pleroma.social/pleroma/relay.git
synced 2024-11-22 22:48:00 +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():
|
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:
|
||||||
|
|
Loading…
Reference in a new issue