Software / code / prosody
Comparison
plugins/mod_storage_internal.lua @ 8402:469afa02947b
mod_storage_internal: Skip write if no items matched a deletion query
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Sun, 19 Nov 2017 21:00:43 +0100 |
| parent | 8394:4892c22403d5 |
| child | 9105:e735c9865f42 |
comparison
equal
deleted
inserted
replaced
| 8401:f1923a79c93d | 8402:469afa02947b |
|---|---|
| 207 end | 207 end |
| 208 end | 208 end |
| 209 end | 209 end |
| 210 end | 210 end |
| 211 local count = count_before - #items; | 211 local count = count_before - #items; |
| 212 if count == 0 then | |
| 213 return 0; -- No changes, skip write | |
| 214 end | |
| 212 local ok, err = datamanager.list_store(username, host, self.store, items); | 215 local ok, err = datamanager.list_store(username, host, self.store, items); |
| 213 if not ok then return ok, err; end | 216 if not ok then return ok, err; end |
| 214 return count; | 217 return count; |
| 215 end | 218 end |
| 216 | 219 |