오픈소스 직접뷰어 기능 추가

This commit is contained in:
koj729
2026-06-15 16:10:05 +09:00
parent d13c414d7f
commit cb0c42fbeb
21 changed files with 1202 additions and 33 deletions

View File

@@ -3576,15 +3576,22 @@ exports.mgmtFunc_resetConvert = async(req, res) => {
let { params } = req.body;
let { resourcePath, dataId } = params;
// convertingDataArr.map(async data => {
// if (data.dataId == dataId) {
// let job = await convertPdfQueue.getJob(data.jobId);
// if (job) await redisConnection.set(`cancel:job:${data.jobId}`, '1');
// }
// })
for (const data of convertingDataArr) {
if (Number(data.dataId) === Number(dataId)) {
try {
const job = await convertPdfQueue.getJob(data.jobId);
if (job) {
await job.remove();
console.log(`[Cancel] Successfully removed job ${data.jobId} from convert-pdf queue`);
}
} catch (jobErr) {
console.error('[Cancel] Error removing job:', jobErr);
}
}
}
//// 배열에서 파일 정보 삭제
convertingDataArr = convertingDataArr.filter(data => data.dataId !== dataId);
convertingDataArr = convertingDataArr.filter(data => Number(data.dataId) !== Number(dataId));
const waiting = await convertPdfQueue.getWaitingCount();
const active = await convertPdfQueue.getActiveCount();