MCPcopy Create free account
hub / github.com/Snapchat/Valdi / restart

Function restart

valdi/vscode_debugger/src/targets/node/nodeLauncherBase.ts:184–208  ·  view source on GitHub ↗

* Restarts the ongoing program.

()

Source from the content-addressed store, hash-verified

182 * Restarts the ongoing program.
183 */
184 public async restart(): Promise<void> {
185 if (!this.run) {
186 return;
187 }
188
189 // connections must be closed, or the process will wait forever:
190 this.closeAllConnections();
191
192 // Clear the program so that termination logic doesn't run.
193 const program = this.program;
194 if (program) {
195 this.program = undefined;
196 await program.stop();
197 }
198
199 // relaunch the program, releasing the initial cancellation token:
200 const cts = CancellationTokenSource.withTimeout(this.run.params.timeout);
201 await this.launchProgram({
202 ...this.run,
203 context: {
204 ...this.run.context,
205 cancellationToken: cts.token,
206 },
207 });
208 }
209
210 public targetList(): ITarget[] {
211 return [...this.targets.value()];

Callers 1

doLaunchMethod · 0.70

Calls 4

withTimeoutMethod · 0.80
stopMethod · 0.65
launchProgramMethod · 0.65
closeAllConnectionsMethod · 0.45

Tested by

no test coverage detected