Diff

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
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;