From 5af166e0637fd1e12621a199a8ad6559bcec6866 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Thu, 4 Apr 2013 10:21:42 -0400 Subject: [PATCH] zephyr_mirror: Limit logging of errors when checking restart stamps. (imported from commit 194b30d757a5f20d6d20bc8aed9154c6aece9837) --- bots/zephyr_mirror_backend.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bots/zephyr_mirror_backend.py b/bots/zephyr_mirror_backend.py index b065048..7a39cc8 100755 --- a/bots/zephyr_mirror_backend.py +++ b/bots/zephyr_mirror_backend.py @@ -258,6 +258,7 @@ def maybe_restart_mirroring_script(): time.sleep(1) def process_loop(log): + restart_check_count = 0 sleep_count = 0 sleep_time = 0.1 while True: @@ -276,8 +277,13 @@ def process_loop(log): try: maybe_restart_mirroring_script() + if restart_check_count > 0: + logging.info("Stopped getting errors checking whether restart is required.") + restart_check_count = 0 except Exception: - logger.exception("Error checking whether restart is required:") + if restart_check_count < 5: + logger.exception("Error checking whether restart is required:") + restart_check_count += 1 time.sleep(sleep_time) sleep_count += sleep_time