File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
yarn-project/pxe/src/contract_function_simulator Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export class ProxiedNodeFactory {
3333 return { perMethod, roundTrips } ;
3434 } ;
3535 } else {
36- return async function ( ...args : any [ ] ) {
36+ return function ( ...args : any [ ] ) {
3737 // Track per-method stats
3838 if ( ! perMethod [ prop ] ) {
3939 perMethod [ prop ] = { times : [ ] } ;
@@ -47,9 +47,11 @@ export class ProxiedNodeFactory {
4747 inFlightCount ++ ;
4848
4949 const callTimer = new Timer ( ) ;
50+ // Use try/finally to ensure cleanup even if the RPC call throws.
51+ // Without this, a failed call would leave inFlightCount incremented,
52+ // breaking round trip tracking for all subsequent calls.
5053 try {
51- const result = await ( target [ prop ] as any ) . apply ( target , args ) ;
52- return result ;
54+ return ( target [ prop ] as any ) . apply ( target , args ) ;
5355 } finally {
5456 const callTime = callTimer . ms ( ) ;
5557 perMethod [ prop ] . times . push ( callTime ) ;
You can’t perform that action at this time.
0 commit comments