Fixed workers and max_concurrent_transmissions
This commit is contained in:
parent
9af6d5cb7c
commit
ebce8e0141
@ -1,6 +1,6 @@
|
|||||||
import logging
|
import logging
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from os import getpid
|
from os import cpu_count, getpid
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from time import time
|
from time import time
|
||||||
from typing import List, Union
|
from typing import List, Union
|
||||||
@ -54,12 +54,16 @@ class PyroClient(Client):
|
|||||||
bot_token=self.config["bot"]["bot_token"],
|
bot_token=self.config["bot"]["bot_token"],
|
||||||
# Workers should be commented when using convopyro, otherwise
|
# Workers should be commented when using convopyro, otherwise
|
||||||
# handlers land in another event loop and you won't see them
|
# handlers land in another event loop and you won't see them
|
||||||
workers=self.config["bot"]["workers"],
|
workers=self.config["bot"]["workers"]
|
||||||
|
if "workers" in self.config["bot"]
|
||||||
|
else min(32, cpu_count() + 4),
|
||||||
plugins=dict(root="plugins", exclude=self.config["disabled_plugins"]),
|
plugins=dict(root="plugins", exclude=self.config["disabled_plugins"]),
|
||||||
sleep_threshold=120,
|
sleep_threshold=120,
|
||||||
max_concurrent_transmissions=self.config["bot"][
|
max_concurrent_transmissions=self.config["bot"][
|
||||||
"max_concurrent_transmissions"
|
"max_concurrent_transmissions"
|
||||||
],
|
]
|
||||||
|
if "max_concurrent_transmissions" in self.config["bot"]
|
||||||
|
else 1,
|
||||||
)
|
)
|
||||||
self.owner: int = self.config["bot"]["owner"]
|
self.owner: int = self.config["bot"]["owner"]
|
||||||
self.commands: List[PyroCommand] = []
|
self.commands: List[PyroCommand] = []
|
||||||
|
Loading…
Reference in New Issue
Block a user