mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-12 19:23:55 +00:00
chore: set asyncio-policy for windows
This commit is contained in:
parent
f6040c5f06
commit
d4ca6617de
|
@ -1,5 +1,6 @@
|
||||||
# flake8: noqa: F401
|
# flake8: noqa: F401
|
||||||
|
|
||||||
|
from freqtrade.configuration.asyncio_config import asyncio_setup
|
||||||
from freqtrade.configuration.config_secrets import sanitize_config
|
from freqtrade.configuration.config_secrets import sanitize_config
|
||||||
from freqtrade.configuration.config_setup import setup_utils_configuration
|
from freqtrade.configuration.config_setup import setup_utils_configuration
|
||||||
from freqtrade.configuration.config_validation import validate_config_consistency
|
from freqtrade.configuration.config_validation import validate_config_consistency
|
||||||
|
|
9
freqtrade/configuration/asyncio_config.py
Normal file
9
freqtrade/configuration/asyncio_config.py
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import asyncio
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
|
def asyncio_setup() -> None:
|
||||||
|
# Set eventloop for win32 setups
|
||||||
|
|
||||||
|
if sys.platform == "win32":
|
||||||
|
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy)
|
|
@ -15,6 +15,7 @@ if sys.version_info < (3, 9): # pragma: no cover
|
||||||
|
|
||||||
from freqtrade import __version__
|
from freqtrade import __version__
|
||||||
from freqtrade.commands import Arguments
|
from freqtrade.commands import Arguments
|
||||||
|
from freqtrade.configuration import asyncio_setup
|
||||||
from freqtrade.constants import DOCS_LINK
|
from freqtrade.constants import DOCS_LINK
|
||||||
from freqtrade.exceptions import ConfigurationError, FreqtradeException, OperationalException
|
from freqtrade.exceptions import ConfigurationError, FreqtradeException, OperationalException
|
||||||
from freqtrade.loggers import setup_logging_pre
|
from freqtrade.loggers import setup_logging_pre
|
||||||
|
@ -33,6 +34,7 @@ def main(sysargv: Optional[List[str]] = None) -> None:
|
||||||
return_code: Any = 1
|
return_code: Any = 1
|
||||||
try:
|
try:
|
||||||
setup_logging_pre()
|
setup_logging_pre()
|
||||||
|
asyncio_setup()
|
||||||
arguments = Arguments(sysargv)
|
arguments = Arguments(sysargv)
|
||||||
args = arguments.get_parsed_arg()
|
args = arguments.get_parsed_arg()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user