Mercurial > prosody-hg
comparison plugins/mod_pubsub/pubsub.lib.lua @ 8302:4852def7dc49
mod_pubsub: Workaround some storage modules without archive key deduplication
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 08 Oct 2017 21:20:21 +0200 |
| parents | e2ab440a3437 |
| children | ab189d3f55d1 |
comparison
equal
deleted
inserted
replaced
| 8301:e2ab440a3437 | 8302:4852def7dc49 |
|---|---|
| 348 end | 348 end |
| 349 function get_set:get(key) | 349 function get_set:get(key) |
| 350 local store = self.store; | 350 local store = self.store; |
| 351 local data, err = archive:find(user, { | 351 local data, err = archive:find(user, { |
| 352 key = key; | 352 key = key; |
| 353 -- Get the last item with that key, if the archive doesn't deduplicate | |
| 354 reverse = true, | |
| 355 limit = 1; | |
| 353 }); | 356 }); |
| 354 if not data then | 357 if not data then |
| 355 module:log("error", "Unable to get item: %s", err); | 358 module:log("error", "Unable to get item: %s", err); |
| 356 return nil, err; | 359 return nil, err; |
| 357 end | 360 end |
