mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-08 18:09:00 +08:00
Nick: auth extract
This commit is contained in:
parent
81c347f538
commit
382476cb36
@ -94,7 +94,7 @@ export async function getACUC(
|
|||||||
let retries = 0;
|
let retries = 0;
|
||||||
const maxRetries = 5;
|
const maxRetries = 5;
|
||||||
|
|
||||||
let rpcName = mode === RateLimiterMode.Extract ? "auth_credit_usage_chunk_extract" : "auth_credit_usage_chunk_test_21_credit_pack_n_extract";
|
let rpcName = mode === RateLimiterMode.Extract || mode === RateLimiterMode.ExtractStatus ? "auth_credit_usage_chunk_extract" : "auth_credit_usage_chunk_test_21_credit_pack_n_extract";
|
||||||
while (retries < maxRetries) {
|
while (retries < maxRetries) {
|
||||||
({ data, error } = await supabase_service.rpc(
|
({ data, error } = await supabase_service.rpc(
|
||||||
rpcName,
|
rpcName,
|
||||||
@ -129,8 +129,6 @@ export async function getACUC(
|
|||||||
setCachedACUC(api_key, chunk);
|
setCachedACUC(api_key, chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log(chunk);
|
|
||||||
|
|
||||||
return chunk;
|
return chunk;
|
||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
|
@ -228,7 +228,7 @@ v1Router.post(
|
|||||||
|
|
||||||
v1Router.get(
|
v1Router.get(
|
||||||
"/extract/:jobId",
|
"/extract/:jobId",
|
||||||
authMiddleware(RateLimiterMode.CrawlStatus),
|
authMiddleware(RateLimiterMode.ExtractStatus),
|
||||||
wrap(extractStatusController),
|
wrap(extractStatusController),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -100,6 +100,10 @@ const RATE_LIMITS = {
|
|||||||
free: 500,
|
free: 500,
|
||||||
default: 5000,
|
default: 5000,
|
||||||
},
|
},
|
||||||
|
extractStatus: {
|
||||||
|
free: 500,
|
||||||
|
default: 5000,
|
||||||
|
},
|
||||||
testSuite: {
|
testSuite: {
|
||||||
free: 10000,
|
free: 10000,
|
||||||
default: 10000,
|
default: 10000,
|
||||||
|
@ -134,6 +134,7 @@ export enum RateLimiterMode {
|
|||||||
Search = "search",
|
Search = "search",
|
||||||
Map = "map",
|
Map = "map",
|
||||||
Extract = "extract",
|
Extract = "extract",
|
||||||
|
ExtractStatus = "extractStatus",
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AuthResponse =
|
export type AuthResponse =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user