Skip to content

Commit 9bceead

Browse files
author
Akos Kitta
committed
feat: no ping timeout in dev mode
Signed-off-by: Akos Kitta <[email protected]>
1 parent d6a4b0f commit 9bceead

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

Diff for: .vscode/launch.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"--plugins=local-dir:../plugins",
2222
"--hosted-plugin-inspect=9339",
2323
"--content-trace",
24-
"--open-devtools"
24+
"--open-devtools",
25+
"--no-ping-timeout",
2526
],
2627
"env": {
2728
"NODE_ENV": "development"
@@ -56,7 +57,8 @@
5657
"--remote-debugging-port=9222",
5758
"--no-app-auto-install",
5859
"--plugins=local-dir:../plugins",
59-
"--hosted-plugin-inspect=9339"
60+
"--hosted-plugin-inspect=9339",
61+
"--no-ping-timeout",
6062
],
6163
"env": {
6264
"NODE_ENV": "development"

Diff for: arduino-ide-extension/src/node/arduino-ide-backend-module.ts

+5
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ import {
109109
} from '../common/protocol/survey-service';
110110
import { IsTempSketch } from './is-temp-sketch';
111111
import { rebindNsfwFileSystemWatcher } from './theia/filesystem/nsfw-watcher/nsfw-bindings';
112+
import { MessagingContribution } from './theia/core/messaging-contribution';
113+
import { MessagingService } from '@theia/core/lib/node/messaging/messaging-service';
112114

113115
export default new ContainerModule((bind, unbind, isBound, rebind) => {
114116
bind(BackendApplication).toSelf().inSingletonScope();
@@ -379,6 +381,9 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
379381
.inSingletonScope();
380382

381383
bind(IsTempSketch).toSelf().inSingletonScope();
384+
rebind(MessagingService.Identifier)
385+
.to(MessagingContribution)
386+
.inSingletonScope();
382387
});
383388

384389
function bindChildLogger(bind: interfaces.Bind, name: string): void {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { MessagingContribution as TheiaMessagingContribution } from '@theia/core/lib/node/messaging/messaging-contribution';
2+
import { injectable } from '@theia/core/shared/inversify';
3+
@injectable()
4+
export class MessagingContribution extends TheiaMessagingContribution {
5+
// https://github.com/eclipse-theia/theia/discussions/11543
6+
protected override checkAliveTimeout = process.argv.includes(
7+
'--no-ping-timeout'
8+
)
9+
? 24 * 60 * 60 * 1_000 // one day
10+
: 30_000;
11+
}

0 commit comments

Comments
 (0)