Comparison

plugins/mod_muc_mam.lua @ 10562:670afc079f68 0.11

mod_muc_mam: Schedule cleanup again on failure
author Kim Alvefur <zash@zash.se>
date Tue, 24 Dec 2019 00:26:40 +0100
parent 10561:29b3eb95c268
child 10563:e8db377a2983
child 10566:f4d12b1434c6
comparison
equal deleted inserted replaced
10561:29b3eb95c268 10562:670afc079f68
458 local ok, err = archive:delete(room, { ["end"] = os.time() - cleanup_after; }) 458 local ok, err = archive:delete(room, { ["end"] = os.time() - cleanup_after; })
459 if ok then 459 if ok then
460 num_rooms = num_rooms + 1; 460 num_rooms = num_rooms + 1;
461 sum = sum + (tonumber(ok) or 0); 461 sum = sum + (tonumber(ok) or 0);
462 else 462 else
463 cleanup_map:set(cut_off, room, true);
463 module:log("error", "Could not delete messages for room '%s': %s", room, err); 464 module:log("error", "Could not delete messages for room '%s': %s", room, err);
464 end 465 end
465 end 466 end
466 module:log("info", "Deleted %d expired messages for %d rooms", sum, num_rooms); 467 module:log("info", "Deleted %d expired messages for %d rooms", sum, num_rooms);
467 end); 468 end);