Skip to content

Commit d2f8287

Browse files
fix(main.py): set default executor for asyncio event loop to improve concurrency
1 parent c0ee05b commit d2f8287

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
import json
33
import logging
44
import os
5+
from concurrent.futures import ThreadPoolExecutor
56
from os import getenv
67

78
from colorlog import ColoredFormatter
8-
from disnake import Intents, Activity, BaseActivity
9+
from disnake import Activity, BaseActivity, Intents
910
from disnake.ext.commands import CommandSyncFlags
1011
from dotenv import load_dotenv
1112

@@ -21,6 +22,7 @@ def main():
2122
main_logger = logging.getLogger("lava.main")
2223

2324
loop = asyncio.new_event_loop()
25+
loop.set_default_executor(ThreadPoolExecutor(max_workers=32))
2426

2527
bot = Bot(
2628
logger=main_logger,

0 commit comments

Comments
 (0)