Skip to content

Commit 0afa62e

Browse files
committed
TASK.getLock失败会返回倒计时而不只是一个true了
1 parent e5d7239 commit 0afa62e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

task.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ function TASK.unlock(name)
2222
locks[name]=-1e99
2323
end
2424
function TASK.getLock(name)
25-
return timer()<locks[name]
25+
local v=locks[name]-timer()
26+
return v>0 and v
2627
end
2728
function TASK.clearLock()
2829
for k in next,locks do

0 commit comments

Comments
 (0)