Skip to content

Commit 7cea69d

Browse files
authored
Merge branch 'main' into jsjoeio/vscode-1.66
2 parents 8a6608a + 4e93db5 commit 7cea69d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/node/wrapper.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,9 @@ class ChildProcess extends Process {
203203

204204
/**
205205
* Parent process wrapper that spawns the child process and performs a handshake
206-
* with it. Will relaunch the child if it receives a SIGUSR1 or is asked to by
207-
* the child. If the child otherwise exits the parent will also exit.
206+
* with it. Will relaunch the child if it receives a SIGUSR1 or SIGUSR2 or is
207+
* asked to by the child. If the child otherwise exits the parent will also
208+
* exit.
208209
*/
209210
export class ParentProcess extends Process {
210211
public logger = logger.named(`parent:${process.pid}`)
@@ -227,6 +228,11 @@ export class ParentProcess extends Process {
227228
this.relaunch()
228229
})
229230

231+
process.on("SIGUSR2", async () => {
232+
this.logger.info("Received SIGUSR2; hotswapping")
233+
this.relaunch()
234+
})
235+
230236
const opts = {
231237
size: "10M",
232238
maxFiles: 10,

0 commit comments

Comments
 (0)