From 6cc5bbeafe0451254bfc5cd3460061b1d3693c2d Mon Sep 17 00:00:00 2001 From: Scott Gasch Date: Tue, 22 Nov 2022 12:07:34 -0800 Subject: [PATCH] Do not touch timestamp if cronjob failed! --- examples/cron/cron.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/cron/cron.py b/examples/cron/cron.py index 4b7d5eb..6e0667d 100755 --- a/examples/cron/cron.py +++ b/examples/cron/cron.py @@ -90,7 +90,7 @@ def run_command(timeout: Optional[int], timestamp_file: Optional[str]) -> int: logger.debug( f"____ (↑↑↑ subprocess finished in {t():.2f}s, exit value was {ret} ↑↑↑) ____" ) - if timestamp_file is not None and os.path.exists(timestamp_file): + if ret == 0 and timestamp_file is not None and os.path.exists(timestamp_file): logger.debug("Touching %s", timestamp_file) file_utils.touch_file(timestamp_file) return ret -- 2.45.2