Skip to content

Commit 6fff9ff

Browse files
Trotttargos
authored andcommitted
debugger: allow longer time to connect
Make five attempts with a timeout of 1 second each rather than 10 attempts with a timeout of 500ms each. This is to allow for slower-connecting devices like Raspberry Pi. PR-URL: #38161 Refs: #36481 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Jan Krems <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Stephen Belanger <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent def85da commit 6fff9ff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/inspector/_inspect.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,13 @@ class NodeInspector {
234234
this.stdout.write(' ok\n');
235235
}, (error) => {
236236
debuglog('connect failed', error);
237-
// If it's failed to connect 10 times then print failed message
238-
if (connectionAttempts >= 10) {
237+
// If it's failed to connect 5 times then print failed message
238+
if (connectionAttempts >= 5) {
239239
this.stdout.write(' failed to connect, please retry\n');
240240
process.exit(1);
241241
}
242242

243-
return new Promise((resolve) => setTimeout(resolve, 500))
243+
return new Promise((resolve) => setTimeout(resolve, 1000))
244244
.then(attemptConnect);
245245
});
246246
};

0 commit comments

Comments
 (0)