Software /
code /
prosody-modules
Comparison
mod_storage_xmlarchive/mod_storage_xmlarchive.lua @ 3462:d73ed7975d82
mod_storage_xmlarchive: Add some debug logging
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 07 Feb 2019 15:26:03 +0100 |
parent | 3453:41e1cacf3c4e |
child | 3491:4e9d4b07e3e9 |
comparison
equal
deleted
inserted
replaced
3461:b54e98d5c4a1 | 3462:d73ed7975d82 |
---|---|
64 if not date or date == dates[d] then | 64 if not date or date == dates[d] then |
65 module:log("debug", "Loading index for %s", dates[d]); | 65 module:log("debug", "Loading index for %s", dates[d]); |
66 local items = dm.list_load(username .. "@" .. dates[d], self.host, self.store) or empty; | 66 local items = dm.list_load(username .. "@" .. dates[d], self.host, self.store) or empty; |
67 for i = 1, #items do | 67 for i = 1, #items do |
68 if items[i].id == id then | 68 if items[i].id == id then |
69 module:log("debug", "Found item!"); | |
69 return d, i, items; | 70 return d, i, items; |
70 end | 71 end |
71 end | 72 end |
72 if date then | 73 if date then |
73 return; -- Assuming no duplicates | 74 return; -- Assuming no duplicates |
74 end | 75 end |
75 elseif date and date < dates[d] then | 76 elseif date and date < dates[d] then |
77 module:log("debug", "Skipping remaining dates after %s", date); | |
76 return; -- List is assumed to be sorted | 78 return; -- List is assumed to be sorted |
77 end | 79 end |
78 end | 80 end |
81 module:log("debug", "Item not found"); | |
79 end | 82 end |
80 | 83 |
81 function archive:find(username, query) | 84 function archive:find(username, query) |
82 username = username or "@"; | 85 username = username or "@"; |
83 query = query or empty; | 86 query = query or empty; |