This commit is contained in:
Nicolas 2024-08-16 22:17:38 -04:00
parent 47123be783
commit f797380112
2 changed files with 15 additions and 1 deletions

View File

@ -49,7 +49,7 @@ export async function checkAlerts() {
};
const checkAll = async () => {
// await checkActiveJobs();
await checkActiveJobs();
await checkWaitingQueue();
};

View File

@ -115,6 +115,20 @@ workerFun(scrapeQueueName, processJobInternal);
async function processJob(job: Job, token: string) {
Logger.info(`🐂 Worker taking job ${job.id}`);
// Check if the job URL is researchhub and block it immediately
// TODO: remove this once solve the root issue
if (job.data.url && job.data.url.includes("researchhub.com")) {
Logger.info(`🐂 Blocking job ${job.id} with URL ${job.data.url}`);
const data = {
success: false,
docs: [],
project_id: job.data.project_id,
error: "URL is blocked: researchhub.com",
};
await job.moveToCompleted(data.docs, token, false);
return data;
}
try {
job.updateProgress({
current: 1,