milo: cleanup

This commit is contained in:
kepler155c@gmail.com
2019-01-04 04:13:00 -05:00
parent 1f00136f42
commit 57aecae996
4 changed files with 17 additions and 29 deletions

View File

@@ -8,10 +8,10 @@ local RefreshTask = {
function RefreshTask:cycle(context)
local now = os.clock()
for node, adapter in context.storage:onlineAdapters() do
for node, adapter in context.storage:onlineAdapters() do
if node.refreshInterval then
if not adapter.lastRefresh or adapter.lastRefresh + node.refreshInterval < now then
_G._debug('REFRESHER: ' .. adapter.name)
_G._debug('REFRESHER: ' .. node.displayName or node.name)
context.storage.dirty = true
adapter.dirty = true
adapter.lastRefresh = now