Get boostrap stuff forking
They don't run yet but seem to be forking correctly now.
This commit is contained in:
@ -44,14 +44,33 @@ export const createApp = (registerMiddleware?: (app: express.Application) => voi
|
||||
const server = new Server(connection, options ? {
|
||||
...options,
|
||||
forkProvider: (message: NewSessionMessage): ChildProcess => {
|
||||
let proc: ChildProcess;
|
||||
const command = message.getCommand();
|
||||
const childLogger = logger.named(command.split("/").pop()!);
|
||||
childLogger.debug("Forking...", field("module", command));
|
||||
|
||||
let proc: ChildProcess;
|
||||
if (message.getIsBootstrapFork()) {
|
||||
proc = forkModule(message.getCommand());
|
||||
proc = forkModule(command);
|
||||
} else {
|
||||
throw new Error("No support for non bootstrap-forking yet");
|
||||
}
|
||||
|
||||
proc.stdout.on("data", (message) => {
|
||||
childLogger.debug("stdout", field("message", message.toString().trim()));
|
||||
});
|
||||
|
||||
proc.stderr.on("data", (message) => {
|
||||
childLogger.debug("stderr", field("message", message.toString().trim()));
|
||||
});
|
||||
|
||||
proc.stdin.on("data", (message) => {
|
||||
childLogger.debug("stdin", field("message", message.toString().trim()));
|
||||
});
|
||||
|
||||
proc.on("exit", (exitCode) => {
|
||||
childLogger.debug(`Exited with ${exitCode}`);
|
||||
});
|
||||
|
||||
return proc;
|
||||
},
|
||||
} : undefined);
|
||||
|
@ -29,7 +29,7 @@ export class SharedProcess {
|
||||
private activeProcess: ChildProcess | undefined;
|
||||
private ipcHandler: StdioIpcHandler | undefined;
|
||||
private readonly onStateEmitter: Emitter<SharedProcessEvent>;
|
||||
private readonly logger = logger.named("SHDR PROC");
|
||||
private readonly logger = logger.named("SHRD PROC");
|
||||
|
||||
public constructor(
|
||||
private readonly userDataDir: string,
|
||||
|
Reference in New Issue
Block a user