From 86714aefa9998d2cfaed448bceacfe71c5d378c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Bournhonesque?= Date: Mon, 18 Mar 2024 14:37:43 +0100 Subject: [PATCH] refactor: add debug logs --- app/_import.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/_import.py b/app/_import.py index ec357cb3..469a8d8d 100644 --- a/app/_import.py +++ b/app/_import.py @@ -76,6 +76,12 @@ def get_processed_since( min_id = f"{start_timestamp_ms}-0" while True: + logger.debug( + "Fetching batch from Redis, stream %s, min_id %s, count %d", + redis_stream_name, + min_id, + batch_size, + ) batch = redis_client.xrange(redis_stream_name, min=min_id, count=batch_size) if not batch: # We reached the end of the stream @@ -513,6 +519,7 @@ def run_update_daemon(config: Config) -> None: continue _id = processed_document.pop("_id") index_id = stream_name_to_index_id[stream_name] + logger.debug("Document:\n%s", processed_document) es_client.index( index=config.indices[index_id].index.name, body=processed_document,