perf: 更改库的加载顺序

This commit is contained in:
Soulter
2024-05-21 08:41:46 +08:00
parent f67b171385
commit 7babb87934
2 changed files with 16 additions and 19 deletions
+10 -8
View File
@@ -4,7 +4,6 @@ import sys
import warnings
import traceback
import threading
from SparkleLogging.utils.core import LogManager
from logging import Formatter, Logger
warnings.filterwarnings("ignore")
@@ -78,19 +77,12 @@ def check_env():
exit()
if __name__ == "__main__":
logger = LogManager.GetLogger(
log_name='astrbot-core',
out_to_console=True,
custom_formatter=Formatter('[%(asctime)s| %(name)s - %(levelname)s|%(filename)s:%(lineno)d]: %(message)s', datefmt="%H:%M:%S")
)
logger.info(logo_tmpl)
# 设置代理
from util.cmd_config import CmdConfig
cc = CmdConfig()
http_proxy = cc.get("http_proxy")
https_proxy = cc.get("https_proxy")
logger.info(f"使用代理: {http_proxy}, {https_proxy}")
if http_proxy:
os.environ['HTTP_PROXY'] = http_proxy
if https_proxy:
@@ -98,6 +90,16 @@ if __name__ == "__main__":
os.environ['NO_PROXY'] = 'https://api.sgroup.qq.com'
update_dept()
from SparkleLogging.utils.core import LogManager
logger = LogManager.GetLogger(
log_name='astrbot-core',
out_to_console=True,
custom_formatter=Formatter('[%(asctime)s| %(name)s - %(levelname)s|%(filename)s:%(lineno)d]: %(message)s', datefmt="%H:%M:%S")
)
logger.info(logo_tmpl)
logger.info(f"使用代理: {http_proxy}, {https_proxy}")
check_env()
t = threading.Thread(target=main, daemon=True)
t.start()