Skip to content

Commit 53dcf49

Browse files
fix: Ensure Snap gets half of allocated init time
1 parent 46c9eb9 commit 53dcf49

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/snaps-controllers/src/services/AbstractExecutionService.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,9 @@ export abstract class AbstractExecutionService<WorkerType>
358358

359359
this.#setupSnapProvider(snapId, rpcStream);
360360

361-
const remainingTime = timer.remaining;
361+
// Use the remaining time as the timer, but ensure that the
362+
// Snap gets at least half the init timeout.
363+
const remainingTime = Math.max(timer.remaining, this.#initTimeout / 2);
362364

363365
const request = {
364366
jsonrpc: '2.0',

0 commit comments

Comments
 (0)