오픈소스 직접뷰어 기능 추가
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user