Browse Source

why timeouts now?

master
Hendrik Langer 1 year ago
parent
commit
c2e440cc4b
  1. 4
      matrix_pygmalion_bot/main.py

4
matrix_pygmalion_bot/main.py

@ -64,13 +64,13 @@ async def main() -> None:
if sys.version_info[0] == 3 and sys.version_info[1] < 11:
tasks = []
for bot in bots:
task = asyncio.create_task(bot.connection.sync_forever(timeout=30000, full_state=True))
task = asyncio.create_task(bot.connection.sync_forever(timeout=0, full_state=True)) # timeout 30000
tasks.append(task)
await asyncio.gather(*tasks)
else:
async with asyncio.TaskGroup() as tg:
for bot in bots:
task = tg.create_task(bot.connection.sync_forever(timeout=30000, full_state=True))
task = tg.create_task(bot.connection.sync_forever(timeout=0, full_state=True)) # timeout 30000
except Exception:
print(traceback.format_exc())

Loading…
Cancel
Save