Skip to content

Commit

Permalink
fix: ensure timeout not nil to avoid `attempt to perform arithmetic o…
Browse files Browse the repository at this point in the history
…n a nil value` error
  • Loading branch information
nic-chen committed Apr 4, 2024
1 parent ba32ec2 commit cf6b8e6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/resty/etcd/v3.lua
Original file line number Diff line number Diff line change
Expand Up @@ -507,6 +507,7 @@ function refresh_jwt_token(self, timeout)
end

if self.requesting_token then
timeout = timeout or self.timeout or 0
self.sema:wait(timeout)
if self.jwt_token and now() - self.last_auth_time < 60 * 3 + random(0, 60) then
return true, nil
Expand Down

0 comments on commit cf6b8e6

Please sign in to comment.