Add version and state to heartbeat message

This commit is contained in:
hroff-1902 2020-02-21 12:26:32 +03:00
parent d2e20d86bb
commit d9ecf3e4bf

View File

@ -102,7 +102,8 @@ class Worker:
if self._heartbeat_interval:
now = time.time()
if (now - self._heartbeat_msg) > self._heartbeat_interval:
logger.info(f"Bot heartbeat. PID={getpid()}")
logger.info(f"Bot heartbeat. PID={getpid()}, "
f"version='{__version__}', state='{state.name}'")
self._heartbeat_msg = now
return state