Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Merge branch 'main' into feat/queue-scrapes

Nicolas46bcbd931f6b
diff --cc apps/api/src/controllers/scrape.ts
index 267fdb509,f594eea8c..7b4ccfd11
--- a/apps/api/src/controllers/scrape.ts
+++ b/apps/api/src/controllers/scrape.ts
@@@ -9,11 -9,11 +9,14 @@@ import { Document } from "../lib/entiti
import { isUrlBlocked } from "../scraper/WebScraper/utils/blocklist"; // Import the isUrlBlocked function
import { numTokensFromString } from '../lib/LLM-extraction/helpers';
import { defaultPageOptions, defaultExtractorOptions, defaultTimeout, defaultOrigin } from '../lib/default-values';
+import { addWebScraperJob } from '../services/queue-jobs';
+import { getWebScraperQueue } from '../services/queue-service';
+import { supabase_service } from '../services/supabase';
+ import { v4 as uuidv4 } from "uuid";
+ import { Logger } from '../lib/logger';
export async function scrapeHelper(
+ jobId: string,
req: Request,
team_id: string,
crawlerOptions: any,
@@@ -148,9 -116,9 +151,9 @@@ export async function scrapeController(
return res.status(402).json({ error: "Insufficient credits" });
}
} catch (error) {
- console.error(error);
+ Logger.error(error);
earlyReturn = true;
- return res.status(402).json({ error: "Error checking team credits. Please contact [email protected] for help." });
+ return res.status(500).json({ error: "Error checking team credits. Please contact [email protected] for help." });
}
};