mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 09:15:54 +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;
|
let retries = 0;
|
||||||
const maxRetries = 5;
|
const maxRetries = 5;
|
||||||
|
|
||||||
|
let isExtract = (mode === RateLimiterMode.Extract || mode === RateLimiterMode.ExtractStatus)
|
||||||
let rpcName =
|
let rpcName =
|
||||||
mode === RateLimiterMode.Extract || mode === RateLimiterMode.ExtractStatus
|
isExtract
|
||||||
? "auth_credit_usage_chunk_extract"
|
? "auth_credit_usage_chunk_extract"
|
||||||
: "auth_credit_usage_chunk_test_22_credit_pack_n_extract";
|
: "auth_credit_usage_chunk_test_22_credit_pack_n_extract";
|
||||||
while (retries < maxRetries) {
|
while (retries < maxRetries) {
|
||||||
@ -132,7 +133,7 @@ export async function getACUC(
|
|||||||
setCachedACUC(api_key, chunk);
|
setCachedACUC(api_key, chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
return chunk;
|
return chunk ? { ...chunk, is_extract: isExtract } : null;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -655,6 +655,7 @@ export type AuthCreditUsageChunk = {
|
|||||||
remaining_credits: number;
|
remaining_credits: number;
|
||||||
sub_user_id: string | null;
|
sub_user_id: string | null;
|
||||||
total_credits_sum: number;
|
total_credits_sum: number;
|
||||||
|
is_extract?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface RequestWithMaybeACUC<
|
export interface RequestWithMaybeACUC<
|
||||||
|
@ -150,7 +150,8 @@ export async function supaCheckTeamCredits(
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
isAutoRechargeEnabled &&
|
isAutoRechargeEnabled &&
|
||||||
chunk.remaining_credits < autoRechargeThreshold
|
chunk.remaining_credits < autoRechargeThreshold &&
|
||||||
|
!chunk.is_extract
|
||||||
) {
|
) {
|
||||||
const autoChargeResult = await autoCharge(chunk, autoRechargeThreshold);
|
const autoChargeResult = await autoCharge(chunk, autoRechargeThreshold);
|
||||||
if (autoChargeResult.success) {
|
if (autoChargeResult.success) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user