Fixed issues with telemetry.

This commit is contained in:
2026-09-08 22:46:20 +02:00
parent 9b0abf6223
commit 1a120bbf86
7 changed files with 300 additions and 52 deletions

View File

@@ -14,6 +14,10 @@ from typing import TYPE_CHECKING, Callable, Mapping
from ...paths import AppPaths
from ...self_update import LauncherUpdateCheck
from ...telemetry import (
TELEMETRY_OPERATION_PROCESS_ROLE,
TELEMETRY_PROCESS_ROLE_VARIABLE,
)
if TYPE_CHECKING:
@@ -465,6 +469,18 @@ def launcher_child_command(*arguments: str) -> list[str]:
return [sys.executable, "-B", "-m", "ptlinux", *arguments]
def launcher_child_environment(
environment: Mapping[str, str] | None = None,
) -> dict[str, str]:
"""Mark an internal CLI process as part of the current dashboard session."""
child_environment = dict(os.environ if environment is None else environment)
child_environment[TELEMETRY_PROCESS_ROLE_VARIABLE] = (
TELEMETRY_OPERATION_PROCESS_ROLE
)
return child_environment
def dashboard_poll_interval(
*,
operation_active: bool,