diff options
author | Kim Alvefur <zash@zash.se> | 2017-11-19 21:00:43 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-11-19 21:00:43 +0100 |
commit | b158553c4326f3f3e8d6cac3a0362e48b3e09d64 (patch) | |
tree | f71f7e0cf261eeca9ac04e2dddd1d1c6441d1a9b /plugins/mod_storage_internal.lua | |
parent | f7d98fa513ffe143f8e0ba987d1a5b6a1d758103 (diff) | |
download | prosody-b158553c4326f3f3e8d6cac3a0362e48b3e09d64.tar.gz prosody-b158553c4326f3f3e8d6cac3a0362e48b3e09d64.zip |
mod_storage_internal: Skip write if no items matched a deletion query
Diffstat (limited to 'plugins/mod_storage_internal.lua')
-rw-r--r-- | plugins/mod_storage_internal.lua | 3 |
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; |