clouddreamai-cicd-setup 1.5.41 → 1.5.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -399,6 +399,12 @@ create_database() {
|
|
|
399
399
|
PG_RESTART_NEEDED=true
|
|
400
400
|
fi
|
|
401
401
|
|
|
402
|
+
# 检查 PostgreSQL 是否有共享内存错误(测试连接)
|
|
403
|
+
if ! sudo -u postgres $PSQL_CMD -c "SELECT 1" >/dev/null 2>&1; then
|
|
404
|
+
echo "检测到 PostgreSQL 连接异常,需要重启..."
|
|
405
|
+
PG_RESTART_NEEDED=true
|
|
406
|
+
fi
|
|
407
|
+
|
|
402
408
|
if [ "$PG_RESTART_NEEDED" = true ]; then
|
|
403
409
|
# 先停掉旧容器,避免 PostgreSQL 重启后出现共享内存错误
|
|
404
410
|
echo "停止旧容器(如果存在)..."
|