fix: entrypoint 容忍 worker 失败,Next.js 独立运行
This commit is contained in:
parent
e47f2c18c0
commit
54b4639af2
|
|
@ -23,11 +23,11 @@ cleanup() {
|
||||||
}
|
}
|
||||||
trap cleanup SIGTERM SIGINT
|
trap cleanup SIGTERM SIGINT
|
||||||
|
|
||||||
# 守护循环:任一进程退出则容器退出
|
# 守护循环:Next.js 退出则容器退出,Worker 失败仅警告
|
||||||
while true; do
|
while true; do
|
||||||
if ! kill -0 $WORKER_PID 2>/dev/null; then
|
if ! kill -0 $WORKER_PID 2>/dev/null; then
|
||||||
echo "[entrypoint] Worker process exited" >&2
|
echo "[entrypoint] Worker process exited (non-fatal)" >&2
|
||||||
exit 1
|
WORKER_PID=0
|
||||||
fi
|
fi
|
||||||
if ! kill -0 $NEXT_PID 2>/dev/null; then
|
if ! kill -0 $NEXT_PID 2>/dev/null; then
|
||||||
echo "[entrypoint] Next.js process exited" >&2
|
echo "[entrypoint] Next.js process exited" >&2
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue