milo wip
This commit is contained in:
16
milo/plugins/refreshTask.lua
Normal file
16
milo/plugins/refreshTask.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
local Milo = require('milo')
|
||||
|
||||
-- Do a full scan of inventories every minute
|
||||
|
||||
local RefreshTask = {
|
||||
name = 'refresher',
|
||||
priority = 0,
|
||||
}
|
||||
|
||||
function RefreshTask:cycle(context)
|
||||
if os.clock() - context.storage.lastRefresh > 60 then
|
||||
context.storage:refresh()
|
||||
end
|
||||
end
|
||||
|
||||
Milo:registerTask(RefreshTask)
|
||||
Reference in New Issue
Block a user