Files
opus-apps/milo/plugins/refreshTask.lua
kepler155c@gmail.com 731fc2c761 change _debug to _syslog
2019-05-03 15:30:37 -04:00

24 lines
535 B
Lua

local Milo = require('milo')
local RefreshTask = {
name = 'refresher',
priority = 0,
}
function RefreshTask:cycle(context)
local now = os.clock()
for node, adapter in context.storage:onlineAdapters() do
if node.refreshInterval then
if not adapter.lastRefresh or adapter.lastRefresh + node.refreshInterval < now then
_G._syslog('REFRESHER: ' .. (node.displayName or node.name))
context.storage.dirty = true
adapter.dirty = true
adapter.lastRefresh = now
end
end
end
end
Milo:registerTask(RefreshTask)