main: don't touch freqbot state in cleanup()

cleanup() should be only called after the main loop has been exited.
At that point the state shouldn't be modified.
This commit is contained in:
gcarq
2018-06-09 01:19:42 +02:00
parent 66f6e71e7e
commit 74db82d759
4 changed files with 12 additions and 17 deletions

View File

@@ -76,17 +76,14 @@ class FreqtradeBot(object):
else:
self.state = State.STOPPED
def clean(self) -> bool:
def cleanup(self) -> None:
"""
Cleanup the application state und finish all pending tasks
Cleanup pending resources on an already stopped bot
:return: None
"""
self.rpc.send_msg('*Status:* `Stopping trader...`')
logger.info('Stopping trader and cleaning up modules...')
self.state = State.STOPPED
logger.info('Cleaning up modules ...')
self.rpc.cleanup()
persistence.cleanup()
return True
def worker(self, old_state: State = None) -> State:
"""