code cleanup; added message to systemd for reconfiguration

This commit is contained in:
hroff-1902
2019-03-11 13:14:55 +03:00
parent 8730852d6e
commit 41add9f8ca
2 changed files with 18 additions and 8 deletions

View File

@@ -60,6 +60,7 @@ def main(sysargv: List[str]) -> None:
logger.exception('Fatal exception!')
finally:
if freqtrade:
freqtrade.stopping()
freqtrade.rpc.send_msg({
'type': RPCMessageType.STATUS_NOTIFICATION,
'status': 'process died'
@@ -72,6 +73,8 @@ def reconfigure(freqtrade: FreqtradeBot, args: Namespace) -> FreqtradeBot:
"""
Cleans up current instance, reloads the configuration and returns the new instance
"""
freqtrade.reconfigure()
# Clean up current modules
freqtrade.cleanup()