Allow explicit viewer lifecycle owner
This commit is contained in:
parent
f6b9816ffd
commit
90898cfd63
1 changed files with 5 additions and 1 deletions
|
|
@ -669,11 +669,15 @@ class DetachedVisualizationRunner:
|
|||
self,
|
||||
index: ProjectIndex,
|
||||
*,
|
||||
owner_pid: int | None = None,
|
||||
initial_grace_seconds: float = DEFAULT_INITIAL_GRACE_SECONDS,
|
||||
lease_seconds: float = DEFAULT_LEASE_SECONDS,
|
||||
monitor_interval_seconds: float = LEASE_MONITOR_INTERVAL_SECONDS,
|
||||
) -> None:
|
||||
if owner_pid is not None and owner_pid <= 1:
|
||||
raise ValueError("Visualization owner PID must identify a live user process")
|
||||
self.index = index
|
||||
self.owner_pid = owner_pid if owner_pid is not None else os.getppid()
|
||||
self.initial_grace_seconds = initial_grace_seconds
|
||||
self.lease_seconds = lease_seconds
|
||||
self.monitor_interval_seconds = monitor_interval_seconds
|
||||
|
|
@ -729,7 +733,7 @@ class DetachedVisualizationRunner:
|
|||
"initial_grace_seconds": self.initial_grace_seconds,
|
||||
"lease_seconds": self.lease_seconds,
|
||||
"monitor_interval_seconds": self.monitor_interval_seconds,
|
||||
"owner_pid": os.getppid(),
|
||||
"owner_pid": self.owner_pid,
|
||||
"target": {
|
||||
"node_id": node_id,
|
||||
"query": query,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue