From be562b8448e97e0b40c4dfe641fcbc32f6ca6641 Mon Sep 17 00:00:00 2001 From: Christopher Usher Date: Tue, 22 Oct 2019 04:04:02 +0100 Subject: [PATCH] added warnings if keeping fewer hours than backfilling --- backfiller/backfiller/main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backfiller/backfiller/main.py b/backfiller/backfiller/main.py index 215ff1f..7ef630b 100644 --- a/backfiller/backfiller/main.py +++ b/backfiller/backfiller/main.py @@ -499,9 +499,13 @@ def main(channels, base_dir='.', qualities='source', metrics_port=8002, try: start = float(start) logging.info('Backfilling last {} hours'.format(start)) + if delete_before and start > delete_before: + logging.warn('Keeping fewer hours ({}) than backfilling ({})'.format(delete_before, start)) except ValueError: start = dateutil.parse(start) - logging.info('Backfilling since {}'.format(start)) + logging.info('Backfilling since {}'.format(start)) + if delete_before: + logging.warn('Only keeping {} hours when backfilling since {}'.format(delete_before, start)) common.PromLogCountsHandler.install() common.install_stacksampler()