@@ -1,5 +1,6 @@
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from freqtrade.persistence import Trade
|
||||
from freqtrade.rpc.rpc import RPC, RPCException
|
||||
|
||||
from .webserver import ApiServer
|
||||
@@ -14,6 +15,7 @@ def get_rpc_optional() -> Optional[RPC]:
|
||||
def get_rpc() -> Optional[RPC]:
|
||||
_rpc = get_rpc_optional()
|
||||
if _rpc:
|
||||
Trade.query.session.rollback()
|
||||
return _rpc
|
||||
else:
|
||||
raise RPCException('Bot is not in the correct state')
|
||||
|
Reference in New Issue
Block a user