fix(lib): use expiration time units in seconds

`os.time()` returns a timestamp in seconds, not milliseconds, but the
expiration time was adding 60,000 assuming it was in milliseconds. This
has now been corrected to only add 60 in seconds.
This commit is contained in:
Erica Marigold 2025-02-05 12:11:10 +05:30
parent e03f07470d
commit 78577110cf
Signed by: DevComp
SSH key fingerprint: SHA256:jD3oMT4WL3WHPJQbrjC3l5feNCnkv7ndW8nYaHX5wFw

View file

@ -217,7 +217,7 @@ function installTool(tool: ToolId, installPath: pathfs.Path): number
-- Write a lock file to prevent concurrent installation attempts -- Write a lock file to prevent concurrent installation attempts
local lockFile: InstallLock = { local lockFile: InstallLock = {
resource = installPath:toString(), resource = installPath:toString(),
expiration = os.time() + 60_000, -- lock expires in 60s from time of issue expiration = os.time() + 60, -- lock expires in 60s from time of issue
} }
pathfs.writeFile(installLockFile, serde.encode("json", lockFile)) pathfs.writeFile(installLockFile, serde.encode("json", lockFile))