Add I Am Alive Message
This commit is contained in:
@@ -50,6 +50,10 @@ class FreqtradeBot:
|
||||
# Init objects
|
||||
self.config = config
|
||||
|
||||
self._last_alive_msg = 0
|
||||
|
||||
self.keep_alive_interval = self.config.get('internals', {}).get('keep_alive_interval', 60)
|
||||
|
||||
self.strategy: IStrategy = StrategyResolver(self.config).strategy
|
||||
|
||||
# Check config consistency here since strategies can set certain options
|
||||
@@ -150,6 +154,11 @@ class FreqtradeBot:
|
||||
self.check_handle_timedout()
|
||||
Trade.session.flush()
|
||||
|
||||
if (self.keep_alive_interval
|
||||
and (arrow.utcnow().timestamp - self._last_alive_msg > self.keep_alive_interval)):
|
||||
logger.info("I am alive.")
|
||||
self._last_alive_msg = arrow.utcnow().timestamp
|
||||
|
||||
def _extend_whitelist_with_trades(self, whitelist: List[str], trades: List[Any]):
|
||||
"""
|
||||
Extend whitelist with pairs from open trades
|
||||
|
Reference in New Issue
Block a user