Comparison

plugins/mod_mam/mod_mam.lua @ 10524:7c29a6e652d2 0.11

mod_mam: Log error when unable to delete old messages (fix #1479) [luacheck]
author Kim Alvefur <zash@zash.se>
date Tue, 24 Dec 2019 00:27:41 +0100
parent 10523:86422db90e02
child 10525:9cf7d9761ca2
comparison
equal deleted inserted replaced
10523:86422db90e02 10524:7c29a6e652d2
385 for user in pairs(users) do 385 for user in pairs(users) do
386 local ok, err = archive:delete(user, { ["end"] = os.time() - cleanup_after; }) 386 local ok, err = archive:delete(user, { ["end"] = os.time() - cleanup_after; })
387 if ok then 387 if ok then
388 num_users = num_users + 1; 388 num_users = num_users + 1;
389 sum = sum + (tonumber(ok) or 0); 389 sum = sum + (tonumber(ok) or 0);
390 else
391 module:log("error", "Could not delete messages for user '%s': %s", user, err);
390 end 392 end
391 end 393 end
392 module:log("info", "Deleted %d expired messages for %d users", sum, num_users); 394 module:log("info", "Deleted %d expired messages for %d users", sum, num_users);
393 end); 395 end);
394 396