Skip to content
Snippets Groups Projects
Commit beab29d3 authored by Calvin Walton's avatar Calvin Walton
Browse files

Ensure the archiver deletes events from redis for the last segment

Issue #6338

It looks like there was a logic error in the code that was causing it
to break out of the event deletion loop early when deleting events for
the last (or only) segment in a recording. (In this case, last_index
is -1, so i >= last_index is always true).

The trim_events_for call was always succeeding, so the events were
being removed from the event list (meeting:{ID}:recordings key) even
though the events themselves hadn't been deleted in the loop.

I've moved the trim_events_for call to below the event deletion loop
to ensure that if the archive script is interrupted, the events list
will contain all not-yet-deleted events.
parent 089dd792
No related branches found
No related tags found
No related merge requests found
......@@ -342,11 +342,11 @@ module BigBlueButton
# Once the events file has been written, we can delete this segment's
# events from redis.
@redis.trim_events_for(meeting_id, last_index)
msgs.each_with_index do |msg, i|
@redis.delete_event_info_for(meeting_id, msg)
break if i >= 0 and i >= last_index
break if last_index >= 0 and i >= last_index
end
@redis.trim_events_for(meeting_id, last_index)
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment