Skip to content

Commit

Permalink
chore(timeout) better check proper timeout values
Browse files Browse the repository at this point in the history
  • Loading branch information
Tieske committed Jul 26, 2022
1 parent 0e2ca2a commit 4871f54
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/copas.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1113,8 +1113,10 @@ do

if delay > 0 then
timeout_register[co] = timerwheel:set(delay, callback, co)
else
elseif delay == 0 then
timeout_register[co] = nil
else
error("timout value must be greater than or equal to 0, got: "..tostring(delay))
end

return true
Expand Down

0 comments on commit 4871f54

Please sign in to comment.