From 3beb42250ac80aa88401729c78a0032175ed6f95 Mon Sep 17 00:00:00 2001 From: deajan Date: Sun, 15 Sep 2024 19:50:53 +0200 Subject: [PATCH] Implement heartbeat log --- npbackup/__env__.py | 4 ++++ npbackup/requirements.txt | 2 +- npbackup/restic_wrapper/__init__.py | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/npbackup/__env__.py b/npbackup/__env__.py index f6067cb..61fe6a9 100644 --- a/npbackup/__env__.py +++ b/npbackup/__env__.py @@ -23,6 +23,10 @@ CHECK_INTERVAL = 0.005 GUI_CHECK_INTERVAL = 0.005 +# Interval on which we log a status message stating we're still alive +# This is useful for long running operations +HEARTBEAT_INTERVAL = 3600 + # Arbitrary timeout for init / init checks. # If init takes more than a minute, we really have a problem in our backend FAST_COMMANDS_TIMEOUT = 60 diff --git a/npbackup/requirements.txt b/npbackup/requirements.txt index 8c613c9..2154278 100644 --- a/npbackup/requirements.txt +++ b/npbackup/requirements.txt @@ -1,4 +1,4 @@ -command_runner>=1.6.0 +command_runner>=1.7.0 cryptidy>=1.2.2 python-dateutil ofunctions.logger_utils>=2.4.1 diff --git a/npbackup/restic_wrapper/__init__.py b/npbackup/restic_wrapper/__init__.py index 64e9c30..643c10a 100644 --- a/npbackup/restic_wrapper/__init__.py +++ b/npbackup/restic_wrapper/__init__.py @@ -23,7 +23,7 @@ from functools import wraps from command_runner import command_runner from ofunctions.misc import BytesConverter, fn_name from npbackup.__debug__ import _DEBUG -from npbackup.__env__ import FAST_COMMANDS_TIMEOUT, CHECK_INTERVAL +from npbackup.__env__ import FAST_COMMANDS_TIMEOUT, CHECK_INTERVAL, HEARTBEAT_INTERVAL from npbackup.path_helper import CURRENT_DIR from npbackup.restic_wrapper import schema @@ -344,6 +344,7 @@ class ResticRunner: priority=self._priority, io_priority=self._priority, windows_no_window=True, + heartbeat=HEARTBEAT_INTERVAL, ) # Don't keep protected environment variables in memory when not necessary self._remove_env()