Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
fix(base) handle case when host.lastQuery is nil (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxf authored and hishamhm committed Dec 10, 2019
1 parent c8557bf commit 1840882
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/resty/dns/balancer/base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ function objBalancer:resolveTimerCallback()
for _, host in ipairs(self.hosts) do
-- only retry the errorred ones
if (host.lastQuery.expire or 0) < time() then
if not host.lastQuery or ((host.lastQuery.expire or 0) < time()) then
ngx_log(ngx_DEBUG, self.log_prefix, "executing requery for: ", host.hostname)
host:queryDns(false) -- timer-context; cacheOnly always false
end
Expand Down

0 comments on commit 1840882

Please sign in to comment.