mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-23 23:48:56 +01:00
Improve emoji, message on content index updated via logger
Use mailbox closed with flag down once content index completed. Use standard, existing logger messages in new indexer messages, when files to index sent by clients
This commit is contained in:
parent
6aa69da3ef
commit
9ba173bc2d
3 changed files with 6 additions and 4 deletions
|
@ -117,7 +117,7 @@ if not state.demo:
|
|||
state.content_index = configure_content(
|
||||
state.content_index, state.config.content_type, all_files, state.search_models
|
||||
)
|
||||
logger.info("📬 Content index updated via Scheduler")
|
||||
logger.info("📪 Content index updated via Scheduler")
|
||||
except Exception as e:
|
||||
logger.error(f"🚨 Error updating content index via Scheduler: {e}", exc_info=True)
|
||||
|
||||
|
|
|
@ -622,7 +622,7 @@ def update(
|
|||
if state.processor_config:
|
||||
components.append("Conversation processor")
|
||||
components_msg = ", ".join(components)
|
||||
logger.info(f"📬 {components_msg} updated via API")
|
||||
logger.info(f"📪 {components_msg} updated via API")
|
||||
|
||||
update_telemetry_state(
|
||||
request=request,
|
||||
|
|
|
@ -85,6 +85,7 @@ async def index_batch(
|
|||
index_batch_request = IndexBatchRequest.parse_raw(index_batch_request_acc)
|
||||
logger.info(f"Received {len(index_batch_request.files)} files")
|
||||
|
||||
logger.info("📬 Updating content index via API")
|
||||
org_files: Dict[str, str] = {}
|
||||
markdown_files: Dict[str, str] = {}
|
||||
pdf_files: Dict[str, str] = {}
|
||||
|
@ -115,7 +116,7 @@ async def index_batch(
|
|||
)
|
||||
|
||||
if state.config == None:
|
||||
logger.info("First run, initializing state.")
|
||||
logger.info("📬 Initializing content index on first run.")
|
||||
default_full_config = FullConfig(
|
||||
content_type=None,
|
||||
search_type=SearchConfig.parse_obj(constants.default_config["search-type"]),
|
||||
|
@ -148,9 +149,10 @@ async def index_batch(
|
|||
)
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to process batch indexing request: {e}", exc_info=True)
|
||||
logger.error(f"🚨 Failed to update content index via API: {e}", exc_info=True)
|
||||
finally:
|
||||
state.config_lock.release()
|
||||
logger.info("📪 Content index updated via API")
|
||||
return Response(content="OK", status_code=200)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue