File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -94,8 +94,9 @@ export async function getACUC(
94
94
let retries = 0 ;
95
95
const maxRetries = 5 ;
96
96
97
+ let isExtract = ( mode === RateLimiterMode . Extract || mode === RateLimiterMode . ExtractStatus )
97
98
let rpcName =
98
- mode === RateLimiterMode . Extract || mode === RateLimiterMode . ExtractStatus
99
+ isExtract
99
100
? "auth_credit_usage_chunk_extract"
100
101
: "auth_credit_usage_chunk_test_22_credit_pack_n_extract" ;
101
102
while ( retries < maxRetries ) {
@@ -132,7 +133,7 @@ export async function getACUC(
132
133
setCachedACUC ( api_key , chunk ) ;
133
134
}
134
135
135
- return chunk ;
136
+ return chunk ? { ... chunk , is_extract : isExtract } : null ;
136
137
} else {
137
138
return null ;
138
139
}
Original file line number Diff line number Diff line change @@ -655,6 +655,7 @@ export type AuthCreditUsageChunk = {
655
655
remaining_credits : number ;
656
656
sub_user_id : string | null ;
657
657
total_credits_sum : number ;
658
+ is_extract ?: boolean ;
658
659
} ;
659
660
660
661
export interface RequestWithMaybeACUC <
Original file line number Diff line number Diff line change @@ -150,7 +150,8 @@ export async function supaCheckTeamCredits(
150
150
151
151
if (
152
152
isAutoRechargeEnabled &&
153
- chunk . remaining_credits < autoRechargeThreshold
153
+ chunk . remaining_credits < autoRechargeThreshold &&
154
+ ! chunk . is_extract
154
155
) {
155
156
const autoChargeResult = await autoCharge ( chunk , autoRechargeThreshold ) ;
156
157
if ( autoChargeResult . success ) {
You can’t perform that action at this time.
0 commit comments