Skip to content

Commit

Permalink
Merge pull request #708 from hubmapconsortium/yuanzhou/reindex-analysis
Browse files Browse the repository at this point in the history
Add start/finish logging on call_reindexer()
  • Loading branch information
yuanzhou authored Aug 18, 2023
2 parents 8958581 + 1b9705f commit 99b4366
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hubmap_translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,8 @@ def create_request_headers_for_auth(self, token):
# Note: this entity dict input (if Dataset) has already removed ingest_metadata.files and
# ingest_metadata.metadata sub fields with empty string values from previous call
def call_indexer(self, entity, reindex=False, document=None, target_index=None):
logger.info(f"Start executing call_indexer() on uuid: {entity['uuid']}, entity_type: {entity['entity_type']}")

try:
if document is None:
try:
Expand Down Expand Up @@ -647,6 +649,8 @@ def call_indexer(self, entity, reindex=False, document=None, target_index=None):
target_doc = document

self.indexer.index(entity['uuid'], target_doc, private_index, reindex)

logger.info(f"Finished executing call_indexer() on uuid: {entity['uuid']}, entity_type: {entity['entity_type']}")
except Exception as e:
logger.exception(e)
msg = f"Exception encountered during executing call_indexer() for uuid: {entity['uuid']}, entity_type: {entity['entity_type']}"
Expand Down

0 comments on commit 99b4366

Please sign in to comment.