Update queue-worker.ts
This commit is contained in:
parent
f797380112
commit
3fe82b4f12
|
@ -117,13 +117,13 @@ async function processJob(job: Job, token: string) {
|
||||||
|
|
||||||
// Check if the job URL is researchhub and block it immediately
|
// Check if the job URL is researchhub and block it immediately
|
||||||
// TODO: remove this once solve the root issue
|
// TODO: remove this once solve the root issue
|
||||||
if (job.data.url && job.data.url.includes("researchhub.com")) {
|
if (job.data.url && (job.data.url.includes("researchhub.com") || job.data.url.includes("ebay.com"))) {
|
||||||
Logger.info(`🐂 Blocking job ${job.id} with URL ${job.data.url}`);
|
Logger.info(`🐂 Blocking job ${job.id} with URL ${job.data.url}`);
|
||||||
const data = {
|
const data = {
|
||||||
success: false,
|
success: false,
|
||||||
docs: [],
|
docs: [],
|
||||||
project_id: job.data.project_id,
|
project_id: job.data.project_id,
|
||||||
error: "URL is blocked: researchhub.com",
|
error: "URL is blocked. Please contact hello@firecrawl.com if you believe this is an error.",
|
||||||
};
|
};
|
||||||
await job.moveToCompleted(data.docs, token, false);
|
await job.moveToCompleted(data.docs, token, false);
|
||||||
return data;
|
return data;
|
||||||
|
@ -137,6 +137,7 @@ async function processJob(job: Job, token: string) {
|
||||||
current_url: "",
|
current_url: "",
|
||||||
});
|
});
|
||||||
const start = Date.now();
|
const start = Date.now();
|
||||||
|
|
||||||
const { success, message, docs } = await startWebScraperPipeline({
|
const { success, message, docs } = await startWebScraperPipeline({
|
||||||
job,
|
job,
|
||||||
token,
|
token,
|
||||||
|
|
Loading…
Reference in New Issue