From 349c0619aa30dba6fe38d70575cea7b710b23e27 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 19 May 2019 20:06:26 +0200 Subject: [PATCH] Move startup to freqtradebot --- freqtrade/freqtradebot.py | 8 ++++++++ freqtrade/worker.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/freqtrade/freqtradebot.py b/freqtrade/freqtradebot.py index 8b29d6d40..425b7e3a9 100644 --- a/freqtrade/freqtradebot.py +++ b/freqtrade/freqtradebot.py @@ -89,6 +89,14 @@ class FreqtradeBot(object): self.rpc.cleanup() persistence.cleanup() + def startup(self) -> None: + """ + Called on startup and after reloading the bot - triggers notifications and + performs startup tasks + : return: None + """ + self.rpc.startup_messages(self.config, self.pairlists) + def process(self) -> bool: """ Queries the persistence layer for open trades and handles them, diff --git a/freqtrade/worker.py b/freqtrade/worker.py index 19a570505..c224b4ee5 100755 --- a/freqtrade/worker.py +++ b/freqtrade/worker.py @@ -91,7 +91,7 @@ class Worker(object): }) logger.info('Changing state to: %s', state.name) if state == State.RUNNING: - self.freqtrade.rpc.startup_messages(self._config, self.freqtrade.pairlists) + self.freqtrade.startup() if state == State.STOPPED: # Ping systemd watchdog before sleeping in the stopped state