refactor: move startup probe to daemon thread with 10s timeout
Move the _run_startup_probe logic into a separate daemon thread within LibraryConfig.ready. This prevents indefinite blocking on startup while maintaining a 10-second wait for the probe result.
This commit is contained in:
@@ -201,6 +201,13 @@ class LibraryConfig(AppConfig):
|
|||||||
def ready(self):
|
def ready(self):
|
||||||
if _should_skip_probe():
|
if _should_skip_probe():
|
||||||
return
|
return
|
||||||
|
import threading
|
||||||
|
|
||||||
|
t = threading.Thread(target=self._probe_thread, daemon=True)
|
||||||
|
t.start()
|
||||||
|
t.join(timeout=10)
|
||||||
|
|
||||||
|
def _probe_thread(self):
|
||||||
try:
|
try:
|
||||||
_run_startup_probe()
|
_run_startup_probe()
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
|||||||
Reference in New Issue
Block a user