Split freqtrade.system into a package

This commit is contained in:
Meng Xiangzhuo
2024-10-04 11:05:49 +08:00
parent 66605e91aa
commit e6dedee56f
5 changed files with 3 additions and 14 deletions

View File

@@ -1,6 +1,5 @@
# flake8: noqa: F401
from freqtrade.configuration.asyncio_config import asyncio_setup
from freqtrade.configuration.config_secrets import sanitize_config
from freqtrade.configuration.config_setup import setup_utils_configuration
from freqtrade.configuration.config_validation import validate_config_consistency

View File

@@ -18,7 +18,8 @@ from freqtrade.commands import Arguments
from freqtrade.constants import DOCS_LINK
from freqtrade.exceptions import ConfigurationError, FreqtradeException, OperationalException
from freqtrade.loggers import setup_logging_pre
from freqtrade.system import asyncio_setup, gc_set_threshold
from freqtrade.system.asyncio_config import asyncio_setup
from freqtrade.system.gc_setup import gc_set_threshold
logger = logging.getLogger("freqtrade")

View File

@@ -0,0 +1 @@
"""system specific and performance tuning"""

View File

@@ -1,23 +1,11 @@
"""System specific or performance tuning"""
import gc
import logging
import platform
import sys
logger = logging.getLogger(__name__)
def asyncio_setup() -> None: # pragma: no cover
# Set eventloop for win32 setups
if sys.platform == "win32":
import asyncio
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
def gc_set_threshold():
"""
Reduce number of GC runs to improve performance (explanation video)