Channel.segmentTimeSec (nullable, null = global SEGMENT_TIME_SEC env var'ı kullan) eklendi. Kanal detay sayfasından dakika cinsinden girilebiliyor, StreamIngestJob'a taşınıp streamIngest.ts'te ffmpeg'in -segment_time argümanına yansıyor. Sadece o kanal için bundan sonra başlayacak yeni kayıt oturumlarını etkiler — halihazırda çalışan bir ffmpeg process'inin segment süresi zaten sabitlenmiş durumda. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
import { Queue } from "bullmq";
|
||
import { redisConnection } from "./redis";
|
||
|
||
/**
|
||
* Queue names are shared across the Node (api-daemon) and Python (worker)
|
||
* services via the protocol-compatible `bullmq` package on both sides.
|
||
* Keep this list in sync with apps/worker/worker/queues.py.
|
||
*/
|
||
export const QUEUE_NAMES = {
|
||
STREAM_INGEST: "stream-ingest",
|
||
SIGNAL_DETECTION: "signal-detection",
|
||
STT_SCORING: "stt-scoring",
|
||
// Defined for future modules (render/distribution) — no processor yet.
|
||
VIDEO_RENDER: "video-render",
|
||
POST_PUBLISH: "post-publish",
|
||
} as const;
|
||
|
||
export interface StreamIngestJob {
|
||
sessionId: string;
|
||
channelDbId: string;
|
||
youtubeUrl: string;
|
||
/** Kanala özel segment süresi (sn) — verilmezse env.segmentTimeSec kullanılır. */
|
||
segmentTimeSec?: number;
|
||
}
|
||
|
||
export interface SignalDetectionJob {
|
||
rawSegmentId: string;
|
||
filePath: string;
|
||
sessionId: string;
|
||
}
|
||
|
||
export const streamIngestQueue = new Queue<StreamIngestJob>(QUEUE_NAMES.STREAM_INGEST, {
|
||
connection: redisConnection,
|
||
});
|
||
|
||
export const signalDetectionQueue = new Queue<SignalDetectionJob>(QUEUE_NAMES.SIGNAL_DETECTION, {
|
||
connection: redisConnection,
|
||
});
|
||
|
||
export interface VideoRenderJob {
|
||
candidateSegmentId: string;
|
||
}
|
||
|
||
// Consumed by the Python worker (apps/worker/worker/video_render.py) — job
|
||
// name/payload shape must match what stt_scoring.py already enqueues.
|
||
export const videoRenderQueue = new Queue<VideoRenderJob>(QUEUE_NAMES.VIDEO_RENDER, {
|
||
connection: redisConnection,
|
||
});
|