Add handling for None field values in logs and make telemetry upload more frequent

This commit is contained in:
sabaimran 2024-01-26 00:00:55 +05:30
parent 737fb6417b
commit 360b59cdb2

View file

@ -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: