File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
packages/agent/src/agent/http Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ <h1>Agent-JS Changelog</h1>
1212 < section >
1313 < h2 > Version x.x.x</ h2 >
1414 < ul >
15+ < li > feat: uses expirable map for subnet keys in agent-js, with a timeout of 1 hour</ li >
1516 < li > chore: cleanup for node 20 development in agent-js</ li >
1617 < li > fix: canisterStatus returns full list of controllers</ li >
1718 < ul >
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ import { AgentHTTPResponseError } from './errors';
3030import { SubnetStatus , request } from '../../canisterStatus' ;
3131import { CertificateVerificationError } from '../../certificate' ;
3232import { ed25519 } from '@noble/curves/ed25519' ;
33+ import { ExpirableMap } from '../../utils/expirableMap' ;
3334import { Ed25519PublicKey } from '../../public_key' ;
3435
3536export * from './transforms' ;
@@ -186,7 +187,9 @@ export class HttpAgent implements Agent {
186187 #queryPipeline: HttpAgentRequestTransformFn [ ] = [ ] ;
187188 #updatePipeline: HttpAgentRequestTransformFn [ ] = [ ] ;
188189
189- #subnetKeys: Map < string , SubnetStatus > = new Map ( ) ;
190+ #subnetKeys: ExpirableMap < string , SubnetStatus > = new ExpirableMap ( {
191+ expirationTime : 60 * 60 * 1000 , // 1 hour
192+ } ) ;
190193 #verifyQuerySignatures = true ;
191194
192195 constructor ( options : HttpAgentOptions = { } ) {
You can’t perform that action at this time.
0 commit comments