consistently name metadata collector

This commit is contained in:
leo
2026-03-18 14:43:46 +01:00
parent 5a0344ff08
commit c274c005ce
6 changed files with 29 additions and 29 deletions
@@ -32,9 +32,9 @@ from minio.error import S3Error
load_dotenv()
logger = logging.getLogger("metadata-extractor")
logger = logging.getLogger("metadata-collector")
AGENT_NAME = os.getenv("ROOM_METADATA_EXTRACTOR_AGENT_NAME", "metadata-extractor")
AGENT_NAME = os.getenv("METADATA_COLLECTOR_AGENT_NAME", "metadata-collector")
def prewarm(proc: JobProcess):
+6 -6
View File
@@ -44,9 +44,9 @@ from core.recording.event.exceptions import (
)
from core.recording.event.notification import notification_service
from core.recording.event.parsers import get_parser
from core.recording.services.metadata_extractor import (
MetadataExtractorException,
MetadataExtractorService,
from core.recording.services.metadata_collector import (
MetadataCollectorException,
MetadataCollectorService,
)
from core.recording.worker.exceptions import (
RecordingStartError,
@@ -341,12 +341,12 @@ class RoomViewSet(
)
if (
settings.ROOM_METADATA_EXTRACTOR_ENABLED
settings.METADATA_COLLECTOR_ENABLED
and recording.mode == models.RecordingModeChoices.TRANSCRIPT
):
try:
MetadataExtractorService().start(recording)
except MetadataExtractorException:
MetadataCollectorService().start(recording)
except MetadataCollectorException:
pass
return drf_response.Response(
@@ -14,11 +14,11 @@ from core import utils
logger = getLogger(__name__)
class MetadataExtractorException(Exception):
class MetadataCollectorException(Exception):
"""Wip."""
class MetadataExtractorService:
class MetadataCollectorService:
"""Wip."""
@async_to_sync
@@ -31,7 +31,7 @@ class MetadataExtractorService:
try:
response = await lkapi.agent_dispatch.create_dispatch(
CreateAgentDispatchRequest(
agent_name=settings.ROOM_METADATA_EXTRACTOR_AGENT_NAME,
agent_name=settings.METADATA_COLLECTOR_AGENT_NAME,
room=room_id,
metadata=str(recording.id),
)
@@ -40,7 +40,7 @@ class MetadataExtractorService:
logger.exception(
"Failed to create metadata extractor agent for room %s", room_id
)
raise MetadataExtractorException(
raise MetadataCollectorException(
"Failed to create metadata extractor agent"
) from e
finally:
@@ -50,7 +50,7 @@ class MetadataExtractorService:
if not dispatch_id:
logger.error("LiveKit response missing dispatch ID for room %s", room_id)
raise MetadataExtractorException(
raise MetadataCollectorException(
f"LiveKit did not return a dispatch_id for room {room_id}"
)
@@ -70,7 +70,7 @@ class MetadataExtractorService:
(
d.id
for d in dispatches
if d.agent_name == settings.ROOM_METADATA_EXTRACTOR_AGENT_NAME
if d.agent_name == settings.METADATA_COLLECTOR_AGENT_NAME
),
None,
)
@@ -90,7 +90,7 @@ class MetadataExtractorService:
"Failed to stop metadata extractor agent dispatch for room %s",
room_name,
)
raise MetadataExtractorException(
raise MetadataCollectorException(
f"Failed to stop metadata metadata extractor agent for room {room_name}"
) from e
finally:
+6 -6
View File
@@ -12,9 +12,9 @@ from django.conf import settings
from livekit import api
from core import models, utils
from core.recording.services.metadata_extractor import (
MetadataExtractorException,
MetadataExtractorService,
from core.recording.services.metadata_collector import (
MetadataCollectorException,
MetadataCollectorService,
)
from core.recording.services.recording_events import (
RecordingEventsError,
@@ -179,12 +179,12 @@ class LiveKitEventsService:
logger.exception("Failed to update room's metadata: %s", e)
if (
settings.ROOM_METADATA_EXTRACTOR_ENABLED
settings.METADATA_COLLECTOR_ENABLED
and recording.mode == models.RecordingModeChoices.TRANSCRIPT
):
try:
MetadataExtractorService().stop(recording)
except MetadataExtractorException:
MetadataCollectorService().stop(recording)
except MetadataCollectorException:
pass
if (
+6 -6
View File
@@ -808,13 +808,13 @@ class Base(Configuration):
environ_prefix=None,
)
# Metadata Extractor settings
ROOM_METADATA_EXTRACTOR_ENABLED = values.BooleanValue(
False, environ_name="ROOM_METADATA_EXTRACTOR_ENABLED", environ_prefix=None
# Metadata collector settings
METADATA_COLLECTOR_ENABLED = values.BooleanValue(
False, environ_name="METADATA_COLLECTOR_ENABLED", environ_prefix=None
)
ROOM_METADATA_EXTRACTOR_AGENT_NAME = values.Value(
"metadata-extractor",
environ_name="ROOM_METADATA_EXTRACTOR_AGENT_NAME",
METADATA_COLLECTOR_AGENT_NAME = values.Value(
"metadata-collector",
environ_name="METADATA_COLLECTOR_AGENT_NAME",
environ_prefix=None,
)
@@ -85,7 +85,7 @@ backend:
AWS_S3_DOMAIN_REPLACE: https://minio.127.0.0.1.nip.io
CELERY_ENABLED: True
CELERY_BROKER_URL: redis://default:pass@redis-master:6379/1
ROOM_METADATA_EXTRACTOR_ENABLED: True
METADATA_COLLECTOR_ENABLED: True
migrate:
@@ -297,7 +297,7 @@ agents:
command:
- "python"
- "metadata_extractor.py"
- "metadata_collector.py"
- "start"
# Extra volume mounts to manage our local custom CA and avoid to disable ssl