Splitting works for more batches; updates never delete a release still in use

- A split part may change the compiled code of its own batch's functions
  still in review (their source is put back as on main; shared changes in the
  file still affect them). It no longer counts as changing functions someone
  else holds; their status is measured again.
- An annotated declaration (a STUB on a prototype) is a region of its own
  instead of stopping the split of the whole file.
- Running processes record the release they started from; update.sh keeps
  those. A worker left running across deploys lost its release directory and
  every analysis failed with "Cannot find module analyze-worker.js".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RNwtXPYqFu3oKaaXwYwNWW
This commit is contained in:
Saty 2026-10-18 12:50:04 +02:00
commit aaba8ad165
5 changed files with 32 additions and 3 deletions

View file

@ -77,8 +77,13 @@ else
fi
fi
# Keep the last three releases for a quick rollback (ln -sfn <release> /opt/togetherdecomp).
# Keep the last three releases for a quick rollback (ln -sfn <release> /opt/togetherdecomp), and
# every release a running process was started from (it loads files from it later, e.g. workers).
inuse=$(cat /var/lib/togetherdecomp/release-*.txt 2>/dev/null)
ls -1dt "$BASE"/*/ | tail -n +4 | while read -r old; do
[ "$(readlink -f "$old")" = "$(readlink -f "$LINK")" ] || rm -rf "$old"
old=$(readlink -f "$old")
[ "$old" = "$(readlink -f "$LINK")" ] && continue
echo "$inuse" | grep -qxF "$old" && continue
rm -rf "$old"
done
echo "== done: $(readlink -f "$LINK")"