mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 12:15:57 +08:00
Nick: fixed the batch scrape + llm extract billing
This commit is contained in:
parent
726430c2e6
commit
0bad436061
@ -121,8 +121,13 @@ export async function runWebScraper({
|
|||||||
: docs;
|
: docs;
|
||||||
|
|
||||||
if(is_scrape === false) {
|
if(is_scrape === false) {
|
||||||
billTeam(team_id, undefined, filteredDocs.length).catch(error => {
|
let creditsToBeBilled = 1; // Assuming 1 credit per document
|
||||||
Logger.error(`Failed to bill team ${team_id} for ${filteredDocs.length} credits: ${error}`);
|
if (extractorOptions && (extractorOptions.mode === "llm-extraction" || extractorOptions.mode === "extract")) {
|
||||||
|
creditsToBeBilled = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
billTeam(team_id, undefined, creditsToBeBilled * filteredDocs.length).catch(error => {
|
||||||
|
Logger.error(`Failed to bill team ${team_id} for ${creditsToBeBilled * filteredDocs.length} credits: ${error}`);
|
||||||
// Optionally, you could notify an admin or add to a retry queue here
|
// Optionally, you could notify an admin or add to a retry queue here
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user