fix: prevent deadlock in concurrent installs

Previously, the code tried to acquire a lock every
1s while checking if it exists. This caused a
deadlock, since the lock got acquired by the
concurrent process after the installation had
completed and the lock was released.
This commit is contained in:
daimond113 2025-02-08 01:12:09 +01:00
parent d27a895e67
commit 95712bc820
No known key found for this signature in database
GPG key ID: 640DC95EC1190354

View file

@ -243,7 +243,7 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number
end
task.wait(1)
isLocked, lockFileContents = tryAcquireLock()
isLocked, lockFileContents = pcall(fs.readFile, installLockFile)
if not isLocked then
return runTool(installPath)
end