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):
|
||||
if _should_skip_probe():
|
||||
return
|
||||
import threading
|
||||
|
||||
t = threading.Thread(target=self._probe_thread, daemon=True)
|
||||
t.start()
|
||||
t.join(timeout=10)
|
||||
|
||||
def _probe_thread(self):
|
||||
try:
|
||||
_run_startup_probe()
|
||||
except Exception as exc:
|
||||
|
||||
Reference in New Issue
Block a user