Skip to content

Commit cc7a0ae

Browse files
authored
fix(webcontainer): optimize timeout error (#99)
1 parent fb53ce7 commit cc7a0ae

File tree

1 file changed

+5
-2
lines changed
  • packages/node-modules-inspector/src/app/webcontainer

1 file changed

+5
-2
lines changed

packages/node-modules-inspector/src/app/webcontainer/container.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@ export async function install(
124124
heartbeat = Date.now()
125125
serverError = undefined
126126

127-
// Max 5000ms between heartbeat and now
127+
// Max 10000 ms between heartbeat and now
128128
// eslint-disable-next-line no-unmodified-loop-condition
129-
while (!result && !serverError && Date.now() - heartbeat < 5000) {
129+
while (!result && !serverError) {
130+
if (Date.now() - heartbeat > 10000) {
131+
throw new Error('Server heartbeat timeout')
132+
}
130133
await new Promise(r => setTimeout(r, 100))
131134
}
132135
if (!result) {

0 commit comments

Comments
 (0)