fix scraper flow
This commit is contained in:
@@ -55,6 +55,30 @@ start_proxy_bridge_if_needed() {
|
||||
echo "[entrypoint] Proxy bridge started (PID ${BRIDGE_PID})"
|
||||
}
|
||||
|
||||
start_self_heal_watchdog_if_worker() {
|
||||
if ! is_worker_command "$@"; then
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ "${IAAI_SELF_HEAL_ENABLED:-true}" = "false" ]; then
|
||||
echo "[entrypoint] Self-heal watchdog disabled"
|
||||
return 0
|
||||
fi
|
||||
|
||||
echo "[entrypoint] Starting self-heal watchdog for worker..."
|
||||
python -m iaai_scraper.worker.self_heal &
|
||||
SELF_HEAL_PID=$!
|
||||
sleep 1
|
||||
|
||||
if ! kill -0 "${SELF_HEAL_PID}" 2>/dev/null; then
|
||||
echo "[entrypoint] ERROR: self-heal watchdog failed to start"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "[entrypoint] Self-heal watchdog started (PID ${SELF_HEAL_PID})"
|
||||
}
|
||||
|
||||
start_proxy_bridge_if_needed "$@"
|
||||
start_self_heal_watchdog_if_worker "$@"
|
||||
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user