Let one process work in a launcher folder at a time, and one job on the same thing.

The window already locked data/launcher.lock, but a second one closed without a word, the command line did not take
the lock, and nothing kept two jobs apart. The lock is now launcher/locks.py: the window, every command but check and
every job that changes files hold it, the one refused says who holds it, and a job names what it changes so that a
second one on the same thing fails before its first step.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
chrg6
2026-11-12 22:06:26 -05:00
parent ec9dd522b1
commit 3ca1541e0e
7 changed files with 421 additions and 38 deletions

View File

@@ -72,6 +72,9 @@ class Layout:
self.cache = self.data / 'cache'
self.downloads = self.data / 'downloads'
self.settings = self.data / 'launcher.json'
# held by whichever process works in this folder: the window while it is open, launcher/cli.py for a command
# and every job that changes files (launcher/locks.py)
self.instance_lock = self.data / 'launcher.lock'
tool_root = self.root
if not ansi_safe(tool_root):
tool_root = Path(os.environ.get('SystemDrive', 'C:') + '\\') / 'NX2navi'