Skip to content

Commit 10f016c

Browse files
authored
Fix H18 timeout by keeping event loop running after startup (#408)
1 parent adc4d2c commit 10f016c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bot.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
import pytz
1313
import sentry_sdk
14-
import tornado
1514

1615
from client_wrapper import ClientWrapper
1716
from constants import (
@@ -1646,10 +1645,11 @@ async def async_main():
16461645
await bot.startup()
16471646

16481647

1649-
def main():
1648+
async def main():
16501649
"""main function for bot command"""
1651-
tornado.ioloop.IOLoop.current().run_sync(async_main)
1650+
await async_main()
1651+
await asyncio.Event().wait()
16521652

16531653

16541654
if __name__ == "__main__":
1655-
main()
1655+
asyncio.run(main())

0 commit comments

Comments
 (0)