Browse Source

why timeouts now?

master
Hendrik Langer 2 years 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: if sys.version_info[0] == 3 and sys.version_info[1] < 11:
tasks = [] tasks = []
for bot in bots: 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) tasks.append(task)
await asyncio.gather(*tasks) await asyncio.gather(*tasks)
else: else:
async with asyncio.TaskGroup() as tg: async with asyncio.TaskGroup() as tg:
for bot in bots: 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: except Exception:
print(traceback.format_exc()) print(traceback.format_exc())

Loading…
Cancel
Save