PayrollManagementSystem/docker/tplus-maintenance.sh
liuwenxin b552f1e567 fix(部署): 将模板迁移 SQL 打包到后端镜像
V28 迁移运行时需要读取 db/migration,补齐镜像复制与构建白名单。
同时保留后端镜像使用的周期检查入口。
2026-11-03 17:18:49 +08:00

24 lines
611 B
Bash

#!/bin/sh
# 复用已有单次检查命令;即使检查失败也保留日志并等待下一轮。
set -u
stopping=0
child_pid=
stop() {
stopping=1
if [ -n "$child_pid" ]; then
kill -TERM "$child_pid" 2>/dev/null || :
fi
}
trap stop TERM INT
while [ "$stopping" -eq 0 ]; do
python -m app.cli tplus-maintain --once &
child_pid=$!
if ! wait "$child_pid" && [ "$stopping" -eq 0 ]; then
echo 'T+ 周期检查未完成,请检查运行配置;下一轮重试。' >&2
fi
[ "$stopping" -eq 0 ] || break
sleep 60 &
child_pid=$!
wait "$child_pid" || :
done