From ab684bdb1547049cb98f2c860e39b7ca35c1f96a Mon Sep 17 00:00:00 2001 From: Khotul Date: Tue, 16 Aug 2022 11:12:17 +0200 Subject: [PATCH] Fix respawn function not working by switching it to node's spawn --- index.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/index.js b/index.js index 4697e7b..2a00678 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ require("coffee-script/register"); require('app-module-path').addPath(__dirname); var log = require("logger"); -var respawn = require("respawn"); +var spawn = require("child_process").spawn; var db = require("database").db; var netconfig = require("config/netconfig"); var path = require("path"); @@ -17,11 +17,7 @@ db.onConnect(1, function (err, connection) { var apps = ["botmanager", "frontend", "gameserver", "lobby"]; apps.forEach(function(appName) { - var app = respawn(['node', path.join(__dirname, './' + appName + "/index.js")], { - kill: 1000, - stdout: process.stdout, - stderr: process.stderr - }); - app.start(); + var app = spawn('node', [appName + "/index.js"]); + app.stdout.pipe(process.stdout); }); });