Skip to content

Commit 2bebe60

Browse files
Speed up eval-worker (#2147)
Speed up eval-worker by removing hack to make it terminate after 1 second. This moves the lowerbound for snap evaluation in the CLI from 1s to potentially milliseconds.
1 parent 1595dca commit 2bebe60

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/snaps-utils/src/eval-worker.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,6 @@ if (invalidExports.length > 0) {
4848
console.warn(`Invalid snap exports detected:\n${invalidExports.join('\n')}`);
4949
}
5050

51-
setTimeout(() => process.exit(0), 1000); // Hack to ensure worker exits
51+
// To ensure the worker exits we explicitly call exit here
52+
// If we didn't the eval would wait for timers set during Compartment eval
53+
process.exit(0);

0 commit comments

Comments
 (0)