Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

import pytz
import sentry_sdk
import tornado

from client_wrapper import ClientWrapper
from constants import (
Expand Down Expand Up @@ -1646,10 +1645,11 @@ async def async_main():
await bot.startup()


def main():
async def main():
"""main function for bot command"""
tornado.ioloop.IOLoop.current().run_sync(async_main)
await async_main()
await asyncio.Event().wait()
Copy link

Copilot AI Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using asyncio.Event().wait() without ever setting the event creates an infinite wait that can only be interrupted by process termination. Consider using a more explicit approach like while True: await asyncio.sleep(3600) or creating a named event that can be set for graceful shutdown.

Suggested change
await asyncio.Event().wait()
while True:
await asyncio.sleep(3600)

Copilot uses AI. Check for mistakes.


if __name__ == "__main__":
main()
asyncio.run(main())