mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2026-09-14 11:06:13 +05:00
Make OpenCode readiness checks race-safe
This commit is contained in:
parent
91aa70cc73
commit
650697f3c2
@ -374,11 +374,13 @@ def _ensure_default_session(settings: dict) -> str:
|
||||
|
||||
|
||||
def _owned_process_running() -> bool:
|
||||
return _PROCESS is not None and _PROCESS.poll() is None
|
||||
process = _PROCESS
|
||||
return process is not None and process.poll() is None
|
||||
|
||||
|
||||
def _owned_process_ready() -> bool:
|
||||
return _owned_process_running() and _PROCESS_READY is _PROCESS
|
||||
process = _PROCESS_READY
|
||||
return process is not None and process is _PROCESS and process.poll() is None
|
||||
|
||||
|
||||
def _health(settings: dict, timeout: float = 2) -> bool:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user