Changeset

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
parents 8401:f1923a79c93d
children 8406:e39edc6d1523
files plugins/mod_storage_internal.lua
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_storage_internal.lua	Thu Nov 09 17:19:11 2017 +0100
+++ b/plugins/mod_storage_internal.lua	Sun Nov 19 21:00:43 2017 +0100
@@ -209,6 +209,9 @@
 		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;