feat: no ping timeout in dev mode

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
Akos Kitta 2022-11-16 14:05:27 +01:00 committed by Akos Kitta
parent d6a4b0f910
commit f553d6919d
3 changed files with 20 additions and 2 deletions

6
.vscode/launch.json vendored
View File

@ -21,7 +21,8 @@
"--plugins=local-dir:../plugins",
"--hosted-plugin-inspect=9339",
"--content-trace",
"--open-devtools"
"--open-devtools",
"--no-ping-timeout",
],
"env": {
"NODE_ENV": "development"
@ -56,7 +57,8 @@
"--remote-debugging-port=9222",
"--no-app-auto-install",
"--plugins=local-dir:../plugins",
"--hosted-plugin-inspect=9339"
"--hosted-plugin-inspect=9339",
"--no-ping-timeout",
],
"env": {
"NODE_ENV": "development"

View File

@ -109,6 +109,8 @@ import {
} from '../common/protocol/survey-service';
import { IsTempSketch } from './is-temp-sketch';
import { rebindNsfwFileSystemWatcher } from './theia/filesystem/nsfw-watcher/nsfw-bindings';
import { MessagingContribution } from './theia/core/messaging-contribution';
import { MessagingService } from '@theia/core/lib/node/messaging/messaging-service';
export default new ContainerModule((bind, unbind, isBound, rebind) => {
bind(BackendApplication).toSelf().inSingletonScope();
@ -379,6 +381,9 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
.inSingletonScope();
bind(IsTempSketch).toSelf().inSingletonScope();
rebind(MessagingService.Identifier)
.to(MessagingContribution)
.inSingletonScope();
});
function bindChildLogger(bind: interfaces.Bind, name: string): void {

View File

@ -0,0 +1,11 @@
import { MessagingContribution as TheiaMessagingContribution } from '@theia/core/lib/node/messaging/messaging-contribution';
import { injectable } from '@theia/core/shared/inversify';
@injectable()
export class MessagingContribution extends TheiaMessagingContribution {
// https://github.com/eclipse-theia/theia/discussions/11543
protected override checkAliveTimeout = process.argv.includes(
'--no-ping-timeout'
)
? 24 * 60 * 60 * 1_000 // one day
: 30_000;
}