From b201bfd64db2ee696ca24754bf51a30f47d80235 Mon Sep 17 00:00:00 2001 From: alikia2x Date: Sat, 22 Mar 2025 23:49:48 +0800 Subject: [PATCH] fix: add type assertions to suppress errors --- src/filterWorker.ts | 4 ++-- src/worker.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/filterWorker.ts b/src/filterWorker.ts index cb42048..b14ef07 100644 --- a/src/filterWorker.ts +++ b/src/filterWorker.ts @@ -1,4 +1,4 @@ -import { Job, Worker } from "bullmq"; +import { ConnectionOptions, Job, Worker } from "bullmq"; import { redis } from "lib/db/redis.ts"; import logger from "lib/log/logger.ts"; import { classifyVideosWorker, classifyVideoWorker } from "lib/mq/exec/classifyVideo.ts"; @@ -32,7 +32,7 @@ const filterWorker = new Worker( break; } }, - { connection: redis, concurrency: 2, removeOnComplete: { count: 1000 } }, + { connection: redis as ConnectionOptions, concurrency: 2, removeOnComplete: { count: 1000 } }, ); filterWorker.on("active", () => { diff --git a/src/worker.ts b/src/worker.ts index da14706..9998569 100644 --- a/src/worker.ts +++ b/src/worker.ts @@ -1,4 +1,4 @@ -import { Job, Worker } from "bullmq"; +import { ConnectionOptions, Job, Worker } from "bullmq"; import { collectSongsWorker, getLatestVideosWorker } from "lib/mq/executors.ts"; import { redis } from "lib/db/redis.ts"; import logger from "lib/log/logger.ts"; @@ -40,7 +40,7 @@ const latestVideoWorker = new Worker( break; } }, - { connection: redis, concurrency: 6, removeOnComplete: { count: 1440 }, removeOnFail: { count: 0 } }, + { connection: redis as ConnectionOptions, concurrency: 6, removeOnComplete: { count: 1440 }, removeOnFail: { count: 0 } }, ); latestVideoWorker.on("active", () => { @@ -73,7 +73,7 @@ const snapshotWorker = new Worker( break; } }, - { connection: redis, concurrency: 10, removeOnComplete: { count: 2000 } }, + { connection: redis as ConnectionOptions, concurrency: 10, removeOnComplete: { count: 2000 } }, ); snapshotWorker.on("error", (err) => {