mirror of https://github.com/aredn/aredn.git
Refresh sysinfo on distance blocked nodes (#1324)
This commit is contained in:
parent
4ce3a6c554
commit
3b1e7947aa
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue