From 3e669af789f29807304f4494ea3090f3165647c4 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Tue, 22 Nov 2016 18:19:55 +0100 Subject: mod_mam: If archive:delete() gives a number, this should be the number of deleted items --- plugins/mod_mam/mod_mam.lua | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'plugins/mod_mam') diff --git a/plugins/mod_mam/mod_mam.lua b/plugins/mod_mam/mod_mam.lua index 2bdf85dc..9d7aabde 100644 --- a/plugins/mod_mam/mod_mam.lua +++ b/plugins/mod_mam/mod_mam.lua @@ -326,11 +326,8 @@ if cleanup_after ~= "never" then local ok, err = archive:delete(user, { ["end"] = os.time() - cleanup_after; }) if not ok then module:log("warn", "Could not expire archives for user %s: %s", user, err); - else - -- :affected() is a recent addition for eg SQLite3 in LuaDBI - pcall(function(stmt) - module:log("debug", "Removed %d messages", stmt:affected()); - end, err); + elseif type(ok) == "number" then + module:log("debug", "Removed %d messages", ok); end cleanup[user] = nil; end -- cgit v1.2.3