mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-05 21:29:11 +00:00
Fix null checking in state for content config API and telemetry API
This commit is contained in:
@@ -253,7 +253,7 @@ def save_chat_session():
|
||||
|
||||
@schedule.repeat(schedule.every(59).minutes)
|
||||
def upload_telemetry():
|
||||
if not state.config.app.should_log_telemetry or not state.telemetry:
|
||||
if not state.config or not state.config.app.should_log_telemetry or not state.telemetry:
|
||||
message = "📡 No telemetry to upload" if not state.telemetry else "📡 Telemetry logging disabled"
|
||||
logger.debug(message)
|
||||
return
|
||||
|
||||
@@ -65,9 +65,10 @@ def content_config_page(request: Request, content_type: str):
|
||||
compressed_jsonl=default_content_type["compressed-jsonl"],
|
||||
embeddings_file=default_content_type["embeddings-file"],
|
||||
)
|
||||
|
||||
current_config = (
|
||||
state.config.content_type[content_type]
|
||||
if state.config and state.config.content_type and content_type in state.config.content_type
|
||||
if state.config and state.config.content_type and state.config.content_type[content_type] # type: ignore
|
||||
else default_config
|
||||
)
|
||||
current_config = json.loads(current_config.json())
|
||||
|
||||
Reference in New Issue
Block a user