This commit is contained in:
kepler155c
2018-10-29 22:00:59 -04:00
parent f24aeb135d
commit 871f44a170
10 changed files with 129 additions and 25 deletions

View File

@@ -44,7 +44,7 @@ function Storage:showStorage()
end
end
if #t > 0 then
debug('Storage:')
debug('Adapter:')
for _, k in pairs(t) do
debug(' offline: ' .. k)
end
@@ -164,7 +164,6 @@ debug('STORAGE: refresh: ' .. adapter.name)
adapter.dirty = false
end
local rcache = adapter.cache or { }
-- TODO: add a method in each adapter that only updates a passed cache
for key,v in pairs(rcache) do
local entry = cache[key]
if not entry then
@@ -172,7 +171,8 @@ debug('STORAGE: refresh: ' .. adapter.name)
entry.count = v.count
entry.key = key
cache[key] = entry
table.insert(items, entry)
items[key] = entry
-- table.insert(items, entry)
else
entry.count = entry.count + v.count
end
@@ -215,7 +215,7 @@ function Storage:provide(item, qty, slot, direction)
end
end
debug('miss: %s - %d', key, qty)
debug('STORAGE: MISS: %s - %d', key, qty)
self.misses = self.misses + 1
for _, adapter in self:onlineAdapters() do