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:
@@ -25,3 +25,12 @@ def on_starting(server):
|
||||
|
||||
def post_worker_init(worker):
|
||||
logging.getLogger("gunicorn.access").addFilter(_filter)
|
||||
from library.apps import _run_startup_probe, _should_skip_probe
|
||||
|
||||
if not _should_skip_probe():
|
||||
try:
|
||||
_run_startup_probe()
|
||||
except Exception as exc:
|
||||
logging.getLogger("library.apps").warning(
|
||||
"Startup probe crashed: %s", exc, exc_info=True
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user