mirror of
https://github.com/suitenumerique/meet.git
synced 2026-08-24 17:27:02 +00:00
🚧(backend) update recording metadata alongside recording state changes
Previously, this was handled manually by the client, sending notifications to other participants and keeping the recording state only in memory. There was no shared or persisted state, so leaving and rejoining a meeting lost this information. Delegating this responsibility solely to the client was a poor choice. The backend now owns this responsibility and relies on LiveKit webhooks to keep room metadata in sync with the egress lifecycle. This also reveals that the room.isRecording attribute does not update as fast as the egress stop event, which is unexpected and should be investigated further. This will make state management working when several room’s owner will be in the same meeting, which is expected to arrive any time soon.
This commit is contained in:
committed by
aleb_the_flash
parent
57a7523cc4
commit
16badde82d
@@ -2,6 +2,7 @@
|
||||
|
||||
import logging
|
||||
|
||||
from core import utils
|
||||
from core.models import Recording, RecordingStatusChoices
|
||||
|
||||
from .exceptions import (
|
||||
@@ -60,6 +61,15 @@ class WorkerServiceMediator:
|
||||
finally:
|
||||
recording.save()
|
||||
|
||||
mode = recording.options.get("original_mode", None) or recording.mode
|
||||
|
||||
try:
|
||||
utils.update_room_metadata(
|
||||
room_name, {"recording_mode": mode, "recording_status": "starting"}
|
||||
)
|
||||
except utils.MetadataUpdateException as e:
|
||||
logger.exception("Failed to update room's metadata: %s", e)
|
||||
|
||||
logger.info(
|
||||
"Worker started for room %s (worker ID: %s)",
|
||||
recording.room,
|
||||
@@ -95,4 +105,10 @@ class WorkerServiceMediator:
|
||||
finally:
|
||||
recording.save()
|
||||
|
||||
try:
|
||||
room_name = str(recording.room.id)
|
||||
utils.update_room_metadata(room_name, {"recording_status": "saving"})
|
||||
except utils.MetadataUpdateException as e:
|
||||
logger.exception("Failed to update room's metadata: %s", e)
|
||||
|
||||
logger.info("Worker stopped for room %s", recording.room)
|
||||
|
||||
Reference in New Issue
Block a user