Comparison

plugins/mod_mam/mod_mam.lua @ 10525:9cf7d9761ca2 0.11

mod_mam: Schedule cleanup again if unable to delete messages
author Kim Alvefur <zash@zash.se>
date Tue, 24 Dec 2019 00:27:44 +0100
parent 10524:7c29a6e652d2
child 10563:e8db377a2983
child 10567:3df479098696
comparison
equal deleted inserted replaced
10524:7c29a6e652d2 10525:9cf7d9761ca2
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 390 else
391 cleanup_map:set(cut_off, user, true);
391 module:log("error", "Could not delete messages for user '%s': %s", user, err); 392 module:log("error", "Could not delete messages for user '%s': %s", user, err);
392 end 393 end
393 end 394 end
394 module:log("info", "Deleted %d expired messages for %d users", sum, num_users); 395 module:log("info", "Deleted %d expired messages for %d users", sum, num_users);
395 end); 396 end);