Skip to content

Commit 5f883c0

Browse files
authored
fix: ensure timeout not nil to avoid attempt to perform arithmetic on a nil value error (#214)
1 parent ba32ec2 commit 5f883c0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
git clone https://github.com/openresty/test-nginx.git test-nginx
5757
cd test-nginx && (sudo cpanm --notest . > build.log 2>&1 || (cat build.log && exit 1)) && cd ..
5858
59-
wget https://raw.githubusercontent.com/api7/apisix-build-tools/master/build-apisix-base.sh
59+
wget https://raw.githubusercontent.com/api7/apisix-build-tools/refs/tags/apisix-base/1.21.4.2.2/build-apisix-base.sh
6060
chmod +x build-apisix-base.sh
6161
OR_PREFIX=$OPENRESTY_PREFIX ./build-apisix-base.sh latest
6262

lib/resty/etcd/v3.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,8 @@ function refresh_jwt_token(self, timeout)
507507
end
508508

509509
if self.requesting_token then
510-
self.sema:wait(timeout)
510+
local wait_timeout = timeout or self.timeout or 0
511+
self.sema:wait(wait_timeout)
511512
if self.jwt_token and now() - self.last_auth_time < 60 * 3 + random(0, 60) then
512513
return true, nil
513514
end

0 commit comments

Comments
 (0)