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);
|
const frpProcess = new OpenFrp(openFrpToken, openFrpTunnelId);
|
||||||
frpProcess.processWrapper.on("start", (pid) => {
|
frpProcess.processWrapper.on("start", (pid: number) => {
|
||||||
logger.info(`Instance ${instance.config.nickname}(${instance.instanceUuid}) ${pid} Frp task started!`);
|
if (pid) {
|
||||||
logger.info(`Params: ${openFrpTunnelId} | ${openFrpToken}`);
|
logger.info(`Instance ${instance.config.nickname}(${instance.instanceUuid}) ${pid} Frp task started!`);
|
||||||
instance.openFrp = frpProcess;
|
logger.info(`Params: ${openFrpTunnelId} | ${openFrpToken}`);
|
||||||
instance.info.openFrpStatus = true;
|
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", () => {
|
frpProcess.processWrapper.on("exit", () => {
|
||||||
logger.info(`Instance ${instance.config.nickname}(${instance.instanceUuid}) Frp task stopped!`);
|
logger.info(`Instance ${instance.config.nickname}(${instance.instanceUuid}) Frp task stopped!`);
|
||||||
|
Loading…
Reference in New Issue
Block a user