Wrap cleanup in try/finally handler
If a database has errors, the database cleanups would fail, causing cleanup to be incomplete. closes #7364
This commit is contained in:
parent
90ec336c70
commit
dc4a4bdf09
@ -142,12 +142,15 @@ class FreqtradeBot(LoggingMixin):
|
||||
:return: None
|
||||
"""
|
||||
logger.info('Cleaning up modules ...')
|
||||
|
||||
try:
|
||||
# Wrap db activities in shutdown to avoid problems if database is gone,
|
||||
# and raises further exceptions.
|
||||
if self.config['cancel_open_orders_on_exit']:
|
||||
self.cancel_all_open_orders()
|
||||
|
||||
self.check_for_open_trades()
|
||||
|
||||
finally:
|
||||
self.strategy.ft_bot_cleanup()
|
||||
|
||||
self.rpc.cleanup()
|
||||
|
Loading…
Reference in New Issue
Block a user