mirror of
https://github.com/pesde-pkg/tooling.git
synced 2025-03-04 02:51:47 +00:00
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:
parent
d27a895e67
commit
95712bc820
1 changed files with 1 additions and 1 deletions
|
@ -243,7 +243,7 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number
|
||||||
end
|
end
|
||||||
|
|
||||||
task.wait(1)
|
task.wait(1)
|
||||||
isLocked, lockFileContents = tryAcquireLock()
|
isLocked, lockFileContents = pcall(fs.readFile, installLockFile)
|
||||||
if not isLocked then
|
if not isLocked then
|
||||||
return runTool(installPath)
|
return runTool(installPath)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue