Use commit instead of .flush()

This commit is contained in:
Matthias
2021-04-13 19:52:33 +02:00
parent eaa47ff335
commit 6fb32c3594
4 changed files with 15 additions and 11 deletions

View File

@@ -569,7 +569,7 @@ class RPC:
# Execute sell for all open orders
for trade in Trade.get_open_trades():
_exec_forcesell(trade)
Trade.query.session.flush()
Trade.query.session.commit()
self._freqtrade.wallets.update()
return {'result': 'Created sell orders for all open trades.'}
@@ -582,7 +582,7 @@ class RPC:
raise RPCException('invalid argument')
_exec_forcesell(trade)
Trade.query.session.flush()
Trade.query.session.commit()
self._freqtrade.wallets.update()
return {'result': f'Created sell order for trade {trade_id}.'}
@@ -705,8 +705,7 @@ class RPC:
lock.active = False
lock.lock_end_time = datetime.now(timezone.utc)
# session is always the same
PairLock.query.session.flush()
PairLock.query.session.commit()
return self._rpc_locks()