File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export const toggleOpenIdMonitoring = async ({
1313
1414 switch ( action ) {
1515 case 'start' : {
16+ await updateRateConfig ( { context} ) ;
1617 await startOpenIdMonitoring ( { context} ) ;
1718 return ;
1819 }
@@ -25,6 +26,25 @@ export const toggleOpenIdMonitoring = async ({
2526 }
2627} ;
2728
29+ const updateRateConfig = async ( { context} : { context : CliContext } ) => {
30+ const { agent} = context ;
31+
32+ const { update_rate_config} = await getObservatoryActor ( {
33+ agent,
34+ canisterId : OBSERVATORY_CANISTER_ID
35+ } ) ;
36+
37+ await update_rate_config (
38+ { OpenIdCertificateRequests : null } ,
39+ {
40+ max_tokens : 300n , // allow up to 300 requests
41+ time_per_token_ns : 200_000_000n // 0.2s per token -> 300/min
42+ }
43+ ) ;
44+
45+ console . log ( 'Rate config applied! ✅' ) ;
46+ } ;
47+
2848const startOpenIdMonitoring = async ( { context} : { context : CliContext } ) => {
2949 const { agent} = context ;
3050
You can’t perform that action at this time.
0 commit comments