mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-10 13:26:13 +00:00
Add handling for None field values in logs and make telemetry upload more frequent
This commit is contained in:
@@ -303,7 +303,7 @@ def configure_search_types():
|
|||||||
return Enum("SearchType", core_search_types)
|
return Enum("SearchType", core_search_types)
|
||||||
|
|
||||||
|
|
||||||
@schedule.repeat(schedule.every(59).minutes)
|
@schedule.repeat(schedule.every(13).minutes)
|
||||||
def upload_telemetry():
|
def upload_telemetry():
|
||||||
if not state.config or not state.config.app or not state.config.app.should_log_telemetry or not state.telemetry:
|
if not state.config or not state.config.app 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"
|
message = "📡 No telemetry to upload" if not state.telemetry else "📡 Telemetry logging disabled"
|
||||||
@@ -316,6 +316,8 @@ def upload_telemetry():
|
|||||||
for log in state.telemetry:
|
for log in state.telemetry:
|
||||||
for field in log:
|
for field in log:
|
||||||
# Check if the value for the field is JSON serializable
|
# Check if the value for the field is JSON serializable
|
||||||
|
if log[field] is None:
|
||||||
|
log[field] = ""
|
||||||
try:
|
try:
|
||||||
json.dumps(log[field])
|
json.dumps(log[field])
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
|||||||
Reference in New Issue
Block a user