aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-11-19 21:00:43 +0100
committerKim Alvefur <zash@zash.se>2017-11-19 21:00:43 +0100
commitbc639cfc91085d7714adb70046e6d324a90b13f2 (patch)
treef71f7e0cf261eeca9ac04e2dddd1d1c6441d1a9b /plugins
parent5bafb3680d035145880aacf9845db7bf69dd2b35 (diff)
downloadprosody-bc639cfc91085d7714adb70046e6d324a90b13f2.tar.gz
prosody-bc639cfc91085d7714adb70046e6d324a90b13f2.zip
mod_storage_internal: Skip write if no items matched a deletion query
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_storage_internal.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/mod_storage_internal.lua b/plugins/mod_storage_internal.lua
index 4395c3f0..27bd8830 100644
--- a/plugins/mod_storage_internal.lua
+++ b/plugins/mod_storage_internal.lua
@@ -209,6 +209,9 @@ function archive:delete(username, query)
end
end
local count = count_before - #items;
+ if count == 0 then
+ return 0; -- No changes, skip write
+ end
local ok, err = datamanager.list_store(username, host, self.store, items);
if not ok then return ok, err; end
return count;