Move webserver start command to seperate file

This commit is contained in:
Matthias
2021-06-20 15:18:41 +02:00
parent e5b1657ab3
commit 5474d5ee64
5 changed files with 18 additions and 17 deletions

View File

@@ -19,4 +19,5 @@ from freqtrade.commands.list_commands import (start_list_exchanges, start_list_h
from freqtrade.commands.optimize_commands import start_backtesting, start_edge, start_hyperopt
from freqtrade.commands.pairlist_commands import start_test_pairlist
from freqtrade.commands.plot_commands import start_plot_dataframe, start_plot_profit
from freqtrade.commands.trade_commands import start_trading, start_webserver
from freqtrade.commands.trade_commands import start_trading
from freqtrade.commands.webserver_commands import start_webserver

View File

@@ -27,16 +27,3 @@ def start_trading(args: Dict[str, Any]) -> int:
logger.info("worker found ... calling exit")
worker.exit()
return 0
def start_webserver(args: Dict[str, Any]) -> None:
"""
Main entry point for webserver mode
"""
from freqtrade.configuration import Configuration
from freqtrade.enums import RunMode
from freqtrade.rpc.api_server import ApiServer
# Initialize configuration
config = Configuration(args, RunMode.WEBSERVER).get_config()
ApiServer(config, standalone=True)

View File

@@ -0,0 +1,15 @@
from typing import Any, Dict
from freqtrade.enums import RunMode
def start_webserver(args: Dict[str, Any]) -> None:
"""
Main entry point for webserver mode
"""
from freqtrade.configuration import Configuration
from freqtrade.rpc.api_server import ApiServer
# Initialize configuration
config = Configuration(args, RunMode.WEBSERVER).get_config()
ApiServer(config, standalone=True)