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

attempt to index field host.lastQuery a nil value #81

Merged
merged 1 commit into from
Dec 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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