Flushing once for all case scenarios
This commit is contained in:
parent
9803130848
commit
cfe8043e87
@ -93,7 +93,6 @@ def _process(nb_assets: Optional[int] = 0) -> bool:
|
||||
# Check if we can sell our current pair
|
||||
state_changed = handle_trade(trade) or state_changed
|
||||
|
||||
Trade.session.flush()
|
||||
except (requests.exceptions.RequestException, json.JSONDecodeError) as error:
|
||||
logger.warning(
|
||||
'Got %s in _process(), retrying in 30 seconds...',
|
||||
@ -107,6 +106,7 @@ def _process(nb_assets: Optional[int] = 0) -> bool:
|
||||
))
|
||||
logger.exception('Got OperationalException. Stopping trader ...')
|
||||
update_state(State.STOPPED)
|
||||
Trade.session.flush()
|
||||
return state_changed
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user