mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 06:15:53 +08:00
Nick: disable auto rech for extract requests
This commit is contained in:
parent
6bfd24d903
commit
e026917698
@ -94,8 +94,9 @@ export async function getACUC(
|
||||
let retries = 0;
|
||||
const maxRetries = 5;
|
||||
|
||||
let isExtract = (mode === RateLimiterMode.Extract || mode === RateLimiterMode.ExtractStatus)
|
||||
let rpcName =
|
||||
mode === RateLimiterMode.Extract || mode === RateLimiterMode.ExtractStatus
|
||||
isExtract
|
||||
? "auth_credit_usage_chunk_extract"
|
||||
: "auth_credit_usage_chunk_test_22_credit_pack_n_extract";
|
||||
while (retries < maxRetries) {
|
||||
@ -132,7 +133,7 @@ export async function getACUC(
|
||||
setCachedACUC(api_key, chunk);
|
||||
}
|
||||
|
||||
return chunk;
|
||||
return chunk ? { ...chunk, is_extract: isExtract } : null;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
@ -655,6 +655,7 @@ export type AuthCreditUsageChunk = {
|
||||
remaining_credits: number;
|
||||
sub_user_id: string | null;
|
||||
total_credits_sum: number;
|
||||
is_extract?: boolean;
|
||||
};
|
||||
|
||||
export interface RequestWithMaybeACUC<
|
||||
|
@ -150,7 +150,8 @@ export async function supaCheckTeamCredits(
|
||||
|
||||
if (
|
||||
isAutoRechargeEnabled &&
|
||||
chunk.remaining_credits < autoRechargeThreshold
|
||||
chunk.remaining_credits < autoRechargeThreshold &&
|
||||
!chunk.is_extract
|
||||
) {
|
||||
const autoChargeResult = await autoCharge(chunk, autoRechargeThreshold);
|
||||
if (autoChargeResult.success) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user