CJ_Clippy 9a708fce1d
Some checks failed
ci / test (push) Failing after 2m41s
fp/our CI/CD / build (push) Successful in 36s
add vibeui player
2025-12-03 03:59:28 -08:00

21 lines
648 B
TypeScript

import { Job } from "bullmq";
import { cacheQueue, cacheQueueEvents } from "../queues/cacheQueue";
type CachePath = string;
export async function getSourceVideo(job: Job, timeout: number = 1000 * 60 * 60 * 5): Promise<CachePath> {
const vodId = job.data.vodId;
await job.log(`First we need to get the vod from cache...`);
const cacheGetJob = await cacheQueue.add(
'cacheGet',
{ vodId },
{ jobId: `cacheGet-${vodId}` }
);
const results = (await cacheGetJob.waitUntilFinished(cacheQueueEvents, timeout));
await job.log(`cacheGet results: ${JSON.stringify(results)}`);
const { cachePath } = results;
return cachePath
}