Skip to content

Commit dc84826

Browse files
authored
fix(muc_cleanup_backend_services): Stops timer before creating new one. (#16894)
* fix(muc_cleanup_backend_services): Stops timer before creating new one. * squash: Adds some logs and skip if already being destroyed.
1 parent b4a64eb commit dc84826

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

resources/prosody-plugins/mod_muc_cleanup_backend_services.lua

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,18 @@ module:hook('muc-occupant-left', function (event)
4040
end
4141

4242
-- seems the room only has jibri and transcriber, add a timeout to destroy the room
43+
if room.empty_destroy_timer then
44+
room.empty_destroy_timer:stop();
45+
end
4346
room.empty_destroy_timer = module:add_timer(EMPTY_TIMEOUT, function()
47+
if room.destroying then return end
4448
room:destroy(nil, 'Empty room with recording and/or transcribing.');
4549

4650
module:log('info',
47-
'the conference terminated %s as being empty for %s seconds with recording/transcribing enabled',
48-
room.jid, EMPTY_TIMEOUT);
51+
'the conference terminated %s as being empty for %s seconds with recording/transcribing enabled. By %s',
52+
room.jid, EMPTY_TIMEOUT, room.empty_destroy_timer);
4953
end)
54+
module:log('info', 'Added room destroy timer %s for %s', room.empty_destroy_timer, room.jid);
5055
end, -100); -- the last thing to execute
5156

5257
module:hook('muc-room-destroyed', function (event)

0 commit comments

Comments
 (0)