refactor(startup): move startup probe to gunicorn worker init
Move probe execution from Django app ready() to gunicorn.conf.py Remove threading implementation to simplify startup sequence Ensure probe runs in worker process context with proper error handling
This commit is contained in:
@@ -199,17 +199,4 @@ class LibraryConfig(AppConfig):
|
||||
verbose_name = "Library"
|
||||
|
||||
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:
|
||||
# Never let the probe itself take down the process.
|
||||
logger.warning("Startup probe crashed: %s", exc, exc_info=True)
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user