Initial upload to Gitea
This commit is contained in:
1 parent
78193254ad
commit
8478998cae
1485 files changed
+461025
-42348
No files matched your search
@@ -23,15 +23,24 @@ if [ ! -x "$PM2_BIN" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while true; do
|
||||
output="$($GENERATOR --quiet --panel-dir "$PANEL_DIR")"
|
||||
changed="$(echo "$output" | awk -F= '/^CHANGED=/{print $2}')"
|
||||
run_cycle() {
|
||||
# adpanel:update-cohort - serialize with update preparation without holding the launcher's lock across PM2 reload.
|
||||
if ! flock -xn 9 || ! node "${PANEL_DIR}/scripts/panel-update-recovery.cjs" --can-autoscale 9<&-; then
|
||||
return 0
|
||||
fi
|
||||
local output changed
|
||||
output="$("$GENERATOR" --quiet --panel-dir "$PANEL_DIR" 9<&-)"
|
||||
changed="$(printf '%s\n' "$output" | awk -F= '/^CHANGED=/{print $2}')"
|
||||
|
||||
if [ "$changed" = "1" ]; then
|
||||
# Apply new worker count and memory limits without requiring full host reboot.
|
||||
"$PM2_BIN" start "$ECOSYSTEM_FILE" --only adpanel --update-env >/dev/null 2>&1 || true
|
||||
"$PM2_BIN" reload adpanel --update-env >/dev/null 2>&1 || "$PM2_BIN" restart adpanel --update-env >/dev/null 2>&1 || true
|
||||
"$PM2_BIN" start "$ECOSYSTEM_FILE" --only adpanel --update-env 9<&- >/dev/null 2>&1 || true
|
||||
"$PM2_BIN" reload adpanel --update-env 9<&- >/dev/null 2>&1 || "$PM2_BIN" restart adpanel --update-env 9<&- >/dev/null 2>&1 || true
|
||||
fi
|
||||
}
|
||||
|
||||
while true; do
|
||||
run_cycle 9<"${PANEL_DIR}/utils"
|
||||
if [ "${1:-}" = "--once" ]; then break; fi
|
||||
sleep "$INTERVAL_SECONDS"
|
||||
done
|
||||
Reference in new issue
Block a user