Merge pull request #5694 from freqtrade/dependabot/pip/develop/fastapi-0.70.0

Bump fastapi from 0.68.1 to 0.70.0
This commit is contained in:
Matthias
2021-10-17 15:01:28 +02:00
committed by GitHub
4 changed files with 6 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
from typing import Any, Dict, Optional
from typing import Any, Dict, Iterator, Optional
from freqtrade.persistence import Trade
from freqtrade.rpc.rpc import RPC, RPCException
@@ -12,11 +12,12 @@ def get_rpc_optional() -> Optional[RPC]:
return None
def get_rpc() -> Optional[RPC]:
def get_rpc() -> Optional[Iterator[RPC]]:
_rpc = get_rpc_optional()
if _rpc:
Trade.query.session.rollback()
return _rpc
yield _rpc
Trade.query.session.rollback()
else:
raise RPCException('Bot is not in the correct state')