Skip to content

Commit f676c34

Browse files
committed
cleanupcleanup
1 parent 7b93a57 commit f676c34

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

yarn-project/pxe/src/contract_function_simulator/proxied_node.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)