comparison mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 2271:b34f4591366a

mod_storage_xmlarchive: Fix date pattern in purge (related to #725)
author Kim Alvefur <zash@zash.se>
date Sat, 13 Aug 2016 16:23:25 +0200
parents 13a8bbf256dd
children aa984980a4dc
comparison
equal deleted inserted replaced
2270:9c99200afd17 2271: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;