mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 09:05:52 +08:00
Nick: fixed billing and acuc cache
This commit is contained in:
parent
1f6abf95e8
commit
6e3ceccb5c
@ -79,7 +79,7 @@ export async function getACUC(
|
||||
useCache = true,
|
||||
mode?: RateLimiterMode,
|
||||
): Promise<AuthCreditUsageChunk | null> {
|
||||
const cacheKeyACUC = `acuc_${api_key}`;
|
||||
const cacheKeyACUC = `acuc_${api_key}_${mode}`;
|
||||
|
||||
if (useCache) {
|
||||
const cachedACUC = await getValue(cacheKeyACUC);
|
||||
@ -94,7 +94,7 @@ export async function getACUC(
|
||||
let retries = 0;
|
||||
const maxRetries = 5;
|
||||
|
||||
let rpcName = mode === RateLimiterMode.Extract ? "auth_credit_usage_chunk_extract" : "auth_credit_usage_chunk_test_21_credit_pack";
|
||||
let rpcName = mode === RateLimiterMode.Extract ? "auth_credit_usage_chunk_extract" : "auth_credit_usage_chunk_test_21_credit_pack_n_extract";
|
||||
while (retries < maxRetries) {
|
||||
({ data, error } = await supabase_service.rpc(
|
||||
rpcName,
|
||||
|
@ -52,12 +52,12 @@ export async function supaBillTeam(
|
||||
credits,
|
||||
});
|
||||
|
||||
const { data, error } = await supabase_service.rpc("bill_team_w_extract", {
|
||||
const { data, error } = await supabase_service.rpc("bill_team_w_extract_3", {
|
||||
_team_id: team_id,
|
||||
sub_id: subscription_id ?? null,
|
||||
fetch_subscription: subscription_id === undefined,
|
||||
credits,
|
||||
is_extract,
|
||||
is_extract_param: is_extract,
|
||||
});
|
||||
|
||||
if (error) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user