mirror of
https://github.com/kurbezz/discord-bot.git
synced 2025-12-06 15:15:37 +01:00
Fix start
This commit is contained in:
14
src/main.py
14
src/main.py
@@ -1,5 +1,5 @@
|
|||||||
from asyncio import wait, create_task
|
|
||||||
import logging
|
import logging
|
||||||
|
import sys
|
||||||
|
|
||||||
from modules.games_list import start as start_games_list_module
|
from modules.games_list import start as start_games_list_module
|
||||||
from modules.stream_notifications import start as start_stream_notifications_module
|
from modules.stream_notifications import start as start_stream_notifications_module
|
||||||
@@ -17,13 +17,17 @@ logger.setLevel(logging.INFO)
|
|||||||
async def main():
|
async def main():
|
||||||
logger.info("Starting services...")
|
logger.info("Starting services...")
|
||||||
|
|
||||||
|
module = sys.argv[1]
|
||||||
|
|
||||||
await mongo_manager.init()
|
await mongo_manager.init()
|
||||||
await redis_manager.init()
|
await redis_manager.init()
|
||||||
|
|
||||||
await wait([
|
if module == "games_list":
|
||||||
create_task(start_games_list_module()),
|
await start_games_list_module()
|
||||||
create_task(start_stream_notifications_module())
|
elif module == "stream_notifications":
|
||||||
], return_when="FIRST_COMPLETED")
|
await start_stream_notifications_module()
|
||||||
|
else:
|
||||||
|
raise RuntimeError(f"Unknown module: {module}")
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user