Refresh sysinfo on distance blocked nodes (#1324)

This commit is contained in:
Tim Wilkinson 2024-08-19 16:21:22 -07:00 committed by GitHub
parent 4ce3a6c554
commit 3b1e7947aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 2 deletions

View File

@ -153,6 +153,13 @@ function should_ping(track)
return true return true
end end
function should_update_info(track)
if track.blocked and not track.blocks.distance then
return false
end
return true
end
function nft(cmd) function nft(cmd)
os.execute(NFT .. " " .. cmd) os.execute(NFT .. " " .. cmd)
end end
@ -630,8 +637,7 @@ function lqm()
-- Refresh the hostname periodically as it can change -- Refresh the hostname periodically as it can change
track.hostname = canonical_hostname(nixio.getnameinfo(track.ip)) or track.hostname track.hostname = canonical_hostname(nixio.getnameinfo(track.ip)) or track.hostname
if track.blocked then if not should_update_info(track) then
-- Remote is blocked
-- We cannot update so invalidate any information considered stale and set time to attempt refresh -- We cannot update so invalidate any information considered stale and set time to attempt refresh
track.refresh = is_pending(track) and 0 or now + refresh_retry_timeout track.refresh = is_pending(track) and 0 or now + refresh_retry_timeout
track.rev_snr = nil track.rev_snr = nil