mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-07 21:29:13 +00:00
Improve logic to disable telemetry via KHOJ_TELEMETRY_DISABLE env var
The newly added KHOJ_TELEMETRY_DISABLE env var knob to disable telemetry should override old config mechanism when set
This commit is contained in:
@@ -256,9 +256,9 @@ def get_server_id():
|
|||||||
|
|
||||||
|
|
||||||
def telemetry_disabled(app_config: AppConfig, telemetry_disable_env) -> bool:
|
def telemetry_disabled(app_config: AppConfig, telemetry_disable_env) -> bool:
|
||||||
return (
|
if telemetry_disable_env is True:
|
||||||
not app_config.should_log_telemetry if app_config and app_config.should_log_telemetry else telemetry_disable_env
|
return True
|
||||||
)
|
return not app_config or not app_config.should_log_telemetry
|
||||||
|
|
||||||
|
|
||||||
def log_telemetry(
|
def log_telemetry(
|
||||||
|
|||||||
Reference in New Issue
Block a user