diff --git a/index.js b/index.js index 4ad8ade..3b4a39d 100644 --- a/index.js +++ b/index.js @@ -150,7 +150,7 @@ async function startBot(accountName) { } return new Promise((resolve, reject) => { - const childProcess = spawn('timeout 150m bash', ['-c', `${commandPrefix} ${commandSuffix}`], { stdio: 'inherit' }); + const childProcess = spawn('bash', ['-c', `${commandPrefix} ${commandSuffix}`], { stdio: 'inherit' }); childProcess.stdout.on('data', (data) => { console.log(`[${accountName}] ${data.toString()}`); @@ -175,6 +175,11 @@ async function startBot(accountName) { consoleLog(`[${host}] Failed to start bot for ${accountName}.`, 'error'); reject(err); }); + + setTimeout(() => { + consoleLog(`[${host}] Bot process for ${accountName} exceeded the timeout. Killing the process...`, 'error'); + childProcess.kill(); + }, 150 * 60 * 1000); }); } else {