From b158553c4326f3f3e8d6cac3a0362e48b3e09d64 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 19 Nov 2017 21:00:43 +0100 Subject: mod_storage_internal: Skip write if no items matched a deletion query --- plugins/mod_storage_internal.lua | 3 +++ 1 file changed, 3 insertions(+) (limited to 'plugins') 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; -- cgit v1.2.3