This commit is contained in:
leo
2026-09-09 14:21:51 +02:00
parent ae506fe6b5
commit f3b19ad4a8
3 changed files with 6 additions and 15 deletions
@@ -77,14 +77,6 @@ class RecordingEventsService:
notification_data={"type": notification_type},
)
except utils.NotificationError as e:
logger.exception(
"Failed to notify participants about recording %s: "
"room=%s, recording_id=%s, mode=%s",
event.value,
recording.room.id,
recording.id,
recording.mode,
)
raise RecordingEventsError(
f"Failed to notify participants in room '{recording.room.id}' about "
f"recording {event.value} (recording_id={recording.id})"
+5 -6
View File
@@ -204,20 +204,18 @@ class LiveKitEventsService:
)
def _lkes_handle_limit_reached(self, data, recording):
# Handle case: EGRESS_LIMIT_REACHED
# question: can we remove or factorize condition on ACTIVE ?
"""Handle status updates to EGRESS_LIMIT_REACHED."""
if (
data.egress_info.status == api.EgressStatus.EGRESS_LIMIT_REACHED
and recording.status == models.RecordingStatusChoices.ACTIVE
):
try:
self.recording_events.handle_limit_reached(recording)
except RecordingEventsError as e:
raise ActionFailedError(
f"Failed to process limit reached event for recording {recording}"
) from e
except RecordingEventsError:
self._log_notification_failure(recording, "limit reached")
def _lkes_handle_aborted(self, data, recording):
"""Handle status updates to EGRESS_ABORTED."""
if (
data.egress_info.status == api.EgressStatus.EGRESS_ABORTED
and recording.status == models.RecordingStatusChoices.ACTIVE
@@ -229,6 +227,7 @@ class LiveKitEventsService:
self._log_notification_failure(recording, "aborted")
def _lkes_handle_failed(self, data, recording):
"""Handle status updates to EGRESS_FAILED."""
if (
data.egress_info.status == api.EgressStatus.EGRESS_FAILED
and recording.is_savable()
@@ -385,7 +385,7 @@ def test_handle_egress_ended_finalizes_recording( # noqa: PLR0913
(
(EgressStatus.EGRESS_ABORTED, "active", "aborted", "screenRecordingAborted"),
(EgressStatus.EGRESS_FAILED, "active", "failed", "screenRecordingFailed"),
(EgressStatus.EGRESS_FAILED, "active", "failed", "screenRecordingFailed"),
(EgressStatus.EGRESS_FAILED, "stopped", "failed", "screenRecordingFailed"),
),
)
@mock.patch("core.utils.notify_participants")