diff --git a/apps/api/src/lib/extract/config.ts b/apps/api/src/lib/extract/config.ts index f8333b3c..bb88804a 100644 --- a/apps/api/src/lib/extract/config.ts +++ b/apps/api/src/lib/extract/config.ts @@ -4,4 +4,8 @@ export const extractConfig = { INITIAL_SCORE_THRESHOLD: 0.75, FALLBACK_SCORE_THRESHOLD: 0.5, MIN_REQUIRED_LINKS: 1, -}; \ No newline at end of file +}; + +export const CUSTOM_U_TEAMS = [ + "874d40cc-a5c0-4e93-b661-9ddfbad5e51e" +] \ No newline at end of file diff --git a/apps/api/src/lib/extract/extraction-service.ts b/apps/api/src/lib/extract/extraction-service.ts index 9793540b..589620cb 100644 --- a/apps/api/src/lib/extract/extraction-service.ts +++ b/apps/api/src/lib/extract/extraction-service.ts @@ -10,6 +10,7 @@ import { logJob } from "../../services/logging/log_job"; import { _addScrapeJobToBullMQ } from "../../services/queue-jobs"; import { saveCrawl, StoredCrawl } from "../crawl-redis"; import { updateExtract } from "./extract-redis"; +import { CUSTOM_U_TEAMS } from "./config"; interface ExtractServiceOptions { request: ExtractRequest; @@ -182,10 +183,15 @@ export async function performExtraction(extractId: string, options: ExtractServi // }, {}, crypto.randomUUID(), 50); // }); + let linksBilled = links.length * 5; + + if(CUSTOM_U_TEAMS.includes(teamId)){ + linksBilled = 1; + } // Bill team for usage - billTeam(teamId, subId, links.length * 5).catch((error) => { + billTeam(teamId, subId, linksBilled).catch((error) => { logger.error( - `Failed to bill team ${teamId} for ${links.length * 5} credits: ${error}`, + `Failed to bill team ${teamId} for ${linksBilled} credits: ${error}`, ); });