mod_storage_xmlarchive/mod_storage_xmlarchive.lua
changeset 2275 b34f4591366a
parent 2187 13a8bbf256dd
child 2293 aa984980a4dc
equal deleted inserted replaced
2274:9c99200afd17 2275:b34f4591366a
   217 end
   217 end
   218 
   218 
   219 function provider:purge(username)
   219 function provider:purge(username)
   220 	for store in dm.stores(username, module.host) do
   220 	for store in dm.stores(username, module.host) do
   221 		local dates = dm.list_load(username, module.host, store) or empty;
   221 		local dates = dm.list_load(username, module.host, store) or empty;
   222 		if dates[1] and type(dates[1]) == "string" and dates[1]:match("^%d%d%d%d%-%d%d-%d%d$") then
   222 		if dates[1] and type(dates[1]) == "string" and dates[1]:match("^%d%d%d%d%-%d%d%-%d%d$") then
   223 			module:log("info", "Store %s looks like an archive store, emptying it...", store);
   223 			module:log("info", "Store %s looks like an archive store, emptying it...", store);
   224 			provider:open(store, "archive"):delete(username);
   224 			provider:open(store, "archive"):delete(username);
   225 		end
   225 		end
   226 	end
   226 	end
   227 	return true;
   227 	return true;