mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 17:35:07 +01:00
Add handling for None field values in logs and make telemetry upload more frequent
This commit is contained in:
parent
737fb6417b
commit
360b59cdb2
1 changed files with 3 additions and 1 deletions
|
@ -303,7 +303,7 @@ def configure_search_types():
|
|||
return Enum("SearchType", core_search_types)
|
||||
|
||||
|
||||
@schedule.repeat(schedule.every(59).minutes)
|
||||
@schedule.repeat(schedule.every(13).minutes)
|
||||
def upload_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"
|
||||
|
@ -316,6 +316,8 @@ def upload_telemetry():
|
|||
for log in state.telemetry:
|
||||
for field in log:
|
||||
# Check if the value for the field is JSON serializable
|
||||
if log[field] is None:
|
||||
log[field] = ""
|
||||
try:
|
||||
json.dumps(log[field])
|
||||
except TypeError:
|
||||
|
|
Loading…
Reference in a new issue