This commit is contained in:
leo
2026-09-09 16:51:15 +02:00
parent 84aa988dd9
commit 43ace65e0c
3 changed files with 10 additions and 10 deletions
@@ -145,7 +145,7 @@ class RecordingEventsService:
cls._notify_participants(recording, RecordingEvent.ABORTED)
@staticmethod
def handle_savable(recording: Recording):
def handle_successful(recording: Recording):
"""Notify external services and save recording."""
if not recording.is_savable():
+3 -3
View File
@@ -238,7 +238,7 @@ class LiveKitEventsService:
except RecordingEventsError:
self._log_notification_failure(recording, "failed")
def _lkes_handle_savable(self, data, recording):
def _lkes_handle_successful(self, data, recording):
"""Finalize the recording, the egress has uploaded the file to the storage.
Recordings are savable for statuses EGRESS_COMPLETE, EGRESS_LIMIT_REACHED.
@@ -248,7 +248,7 @@ class LiveKitEventsService:
api.EgressStatus.EGRESS_LIMIT_REACHED,
]:
try:
self.recording_events.handle_savable(recording)
self.recording_events.handle_successful(recording)
except RecordingNotSavableError:
logger.warning(
"Recording %s is not savable on egress complete "
@@ -298,7 +298,7 @@ class LiveKitEventsService:
self._lkes_handle_aborted(data, recording)
self._lkes_handle_failed(data, recording)
# Handle EGRESS_COMPLETE & EGRESS_LIMIT_REACHED
self._lkes_handle_savable(data, recording)
self._lkes_handle_successful(data, recording)
@staticmethod
def _is_connection_test_room(room_name: str) -> bool:
@@ -139,19 +139,19 @@ def test_handle_event_notification_error( # noqa: PLR0913
"core.recording.services.recording_events.notification_service."
"notify_external_services"
)
def test_handle_savable_saves_recording( # pylint: disable=too-many-arguments, too-many-positional-arguments
def test_handle_successful_saves_recording( # pylint: disable=too-many-arguments, too-many-positional-arguments
mock_notify_external_services,
notify_return_value,
expected_status,
status,
service,
):
"""Test handle_savable notifies external services and saves a savable recording."""
"""Test handle_successful notifies external services and saves a savable recording."""
mock_notify_external_services.return_value = notify_return_value
recording = RecordingFactory(status=status)
service.handle_savable(recording)
service.handle_successful(recording)
mock_notify_external_services.assert_called_once_with(recording)
@@ -174,15 +174,15 @@ def test_handle_savable_saves_recording( # pylint: disable=too-many-arguments,
"core.recording.services.recording_events.notification_service."
"notify_external_services"
)
def test_handle_savable_non_savable_recording(
def test_handle_successful_non_savable_recording(
mock_notify_external_services, status, service
):
"""Test handle_savable refuses recordings that are already saved or in error."""
"""Test handle_successful refuses recordings that are already saved or in error."""
recording = RecordingFactory(status=status)
with pytest.raises(RecordingNotSavableError):
service.handle_savable(recording)
service.handle_successful(recording)
mock_notify_external_services.assert_not_called()