Skip to content

Commit

Permalink
refactor: add debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael0202 committed Mar 18, 2024
1 parent 30acfef commit 86714ae
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/_import.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 86714ae

Please sign in to comment.