Merge pull request #446 from Monadical-SAS/fix-reprocessing

Fix reprocessing
This commit is contained in:
2025-01-23 17:58:30 +01:00
committed by GitHub
5 changed files with 71 additions and 71 deletions

38
compose.yml Normal file
View File

@@ -0,0 +1,38 @@
services:
server:
build:
context: server
ports:
- 1250:1250
volumes:
- ./server/data/:/app/data/
env_file:
- ./server/.env
environment:
ENTRYPOINT: server
worker:
build:
context: server
volumes:
- ./server/data/:/app/data/
env_file:
- ./server/.env
environment:
ENTRYPOINT: worker
redis:
image: redis:7.2
ports:
- 6379:6379
web:
image: node:18
ports:
- "3000:3000"
command: sh -c "yarn install && yarn dev"
restart: unless-stopped
working_dir: /app
volumes:
- ./www:/app/
env_file:
- ./www/.env.local

View File

@@ -1,28 +0,0 @@
version: "3.9"
services:
server:
build:
context: server
ports:
- 1250:1250
volumes:
- model-cache:/root/.cache
environment: ENTRYPOINT=server
worker:
build:
context: server
volumes:
- model-cache:/root/.cache
environment: ENTRYPOINT=worker
redis:
image: redis:7.2
ports:
- 6379:6379
web:
build:
context: www
ports:
- 3000:3000
volumes:
model-cache:

View File

@@ -1,27 +0,0 @@
version: "3.9"
services:
server:
build:
context: .
ports:
- 1250:1250
volumes:
- model-cache:/root/.cache
environment:
ENTRYPOINT: server
REDIS_HOST: redis
worker:
build:
context: .
volumes:
- model-cache:/root/.cache
environment:
ENTRYPOINT: worker
REDIS_HOST: redis
redis:
image: redis:7.2
ports:
- 6379:6379
volumes:
model-cache:

View File

@@ -53,7 +53,11 @@ from reflector.processors.types import (
from reflector.processors.types import Transcript as TranscriptProcessorType
from reflector.settings import settings
from reflector.ws_manager import WebsocketManager, get_ws_manager
from reflector.zulip import get_zulip_message, send_message_to_zulip
from reflector.zulip import (
get_zulip_message,
send_message_to_zulip,
update_zulip_message,
)
from structlog import BoundLogger as Logger
@@ -573,10 +577,27 @@ async def pipeline_post_to_zulip(transcript: Transcript, logger: Logger):
if room.zulip_auto_post:
message = get_zulip_message(transcript=transcript, include_topics=True)
response = send_message_to_zulip(room.zulip_stream, room.zulip_topic, message)
await transcripts_controller.update(
transcript, {"zulip_message_id": response["id"]}
)
message_updated = False
if transcript.zulip_message_id:
try:
update_zulip_message(
transcript.zulip_message_id,
room.zulip_stream,
room.zulip_topic,
message,
)
message_updated = True
except Exception:
logger.error(
f"Failed to update zulip message with id {transcript.zulip_message_id}"
)
if not message_updated:
response = send_message_to_zulip(
room.zulip_stream, room.zulip_topic, message
)
await transcripts_controller.update(
transcript, {"zulip_message_id": response["id"]}
)
logger.info("Posted to zulip")
@@ -665,6 +686,13 @@ async def pipeline_process(transcript: Transcript, logger: Logger):
try:
if transcript.audio_location == "storage":
await transcripts_controller.download_mp3_from_storage(transcript)
transcript.audio_waveform_filename.unlink(missing_ok=True)
await transcripts_controller.update(
transcript,
{
"topics": [],
},
)
# open audio
audio_filename = next(transcript.data_path.glob("upload.*"), None)

View File

@@ -1,11 +0,0 @@
version: "3.9"
services:
server:
build:
context: .
ports:
- 80:80
environment:
LLM_URL: "${LLM_URL}"
volumes:
- model-cache:/root/.cache