Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit f4ea15a

Browse files
add restart log.
1 parent ada6d8c commit f4ea15a

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

dist/messenger.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { ChildProcess } from 'node:child_process';
44
export declare type MessengerHandlerFunction<R = any, T = any> = (payload: T, unsubscriber?: () => void) => Promise<R> | R;
55
export declare type MessengerListenerFunction<T = any> = (payload: T, unsubscriber?: () => void) => Promise<void> | void;
66
export declare class Messenger {
7-
private readonly who;
7+
protected readonly who: string;
88
private onMessageHandler;
99
private onExitHandler;
1010
private readonly pendingMessages;

dist/process-helper.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class ProcessHelper extends messenger_1.Messenger {
3636
}
3737
if (autoRestart) {
3838
this.autoRestartListener = () => {
39+
console.log('restarting process..', this.who);
3940
this.disconnect();
4041
this.childProcess = undefined;
4142
this.autoRestartListener = undefined;

src/messenger.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class Messenger {
4545

4646
private channel: NodeJS.Process | ChildProcess | undefined;
4747

48-
constructor(channel?: NodeJS.Process | ChildProcess, private readonly who = 'unknown') {
48+
constructor(channel?: NodeJS.Process | ChildProcess, protected readonly who = 'unknown') {
4949
if (channel) {
5050
this.connect(channel);
5151
}

src/process-helper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export class ProcessHelper extends Messenger {
5555

5656
if (autoRestart) {
5757
this.autoRestartListener = () => {
58+
console.log('restarting process..', this.who);
5859
this.disconnect();
5960

6061
this.childProcess = undefined;

0 commit comments

Comments
 (0)