persistent cache item now need an explicit persistent flag

pull/1071/head
chrox 10 years ago
parent 8c9751744e
commit f48c073357

@ -136,8 +136,11 @@ function Cache:serialize()
-- serialize the most recently used cache
local cache_size = 0
for _, key in ipairs(self.cache_order) do
if self.cache[key].dump then
cache_size = self.cache[key]:dump(cache_path..md5(key)) or 0
local cache_item = self.cache[key]
-- only dump cache item that requests serialization explicitly
if cache_item.persistent and cache_item.dump then
DEBUG("dump cache item", key)
cache_size = cache_item:dump(cache_path..md5(key)) or 0
if cache_size > 0 then break end
end
end

Loading…
Cancel
Save