forked from mirror/MCSM-Daemon
Fix: check pid when frp started
This commit is contained in:
parent
82878b1299
commit
33eea8a7b7
@ -69,11 +69,15 @@ export default class OpenFrpTask implements ILifeCycleTask {
|
||||
}
|
||||
|
||||
const frpProcess = new OpenFrp(openFrpToken, openFrpTunnelId);
|
||||
frpProcess.processWrapper.on("start", (pid) => {
|
||||
logger.info(`Instance ${instance.config.nickname}(${instance.instanceUuid}) ${pid} Frp task started!`);
|
||||
logger.info(`Params: ${openFrpTunnelId} | ${openFrpToken}`);
|
||||
instance.openFrp = frpProcess;
|
||||
instance.info.openFrpStatus = true;
|
||||
frpProcess.processWrapper.on("start", (pid: number) => {
|
||||
if (pid) {
|
||||
logger.info(`Instance ${instance.config.nickname}(${instance.instanceUuid}) ${pid} Frp task started!`);
|
||||
logger.info(`Params: ${openFrpTunnelId} | ${openFrpToken}`);
|
||||
instance.openFrp = frpProcess;
|
||||
instance.info.openFrpStatus = true;
|
||||
} else {
|
||||
logger.warn(`Instance ${instance.config.nickname}(${instance.instanceUuid}) Frp task start failed! Process ID is ${pid}`);
|
||||
}
|
||||
});
|
||||
frpProcess.processWrapper.on("exit", () => {
|
||||
logger.info(`Instance ${instance.config.nickname}(${instance.instanceUuid}) Frp task stopped!`);
|
||||
|
Loading…
Reference in New Issue
Block a user