From aba2739c174b20752ddca5586a379d9ac3d3c259 Mon Sep 17 00:00:00 2001 From: samcm Date: Thu, 8 Mar 2018 19:11:40 +1100 Subject: [PATCH] Undo muthithreading for websockets --- webapp.js | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/webapp.js b/webapp.js index 39647da7..300933ec 100644 --- a/webapp.js +++ b/webapp.js @@ -189,27 +189,28 @@ killOldInvites() var shortenedLinks = {} loadFromFile((result) => { shortenedLinks = result - const cluster = require('cluster'); - const http = require('http'); - const numCPUs = require('os').cpus().length; + // const cluster = require('cluster'); + // const http = require('http'); + // const numCPUs = require('os').cpus().length; - if (cluster.isMaster) { - // Fork workers. - setInterval(() => { - if (cluster.isMaster) { - killOldInvites() - } - }, 3600000) - for (let i = 0; i < numCPUs; i++) { - cluster.fork(); - } + // if (cluster.isMaster) { + // // Fork workers. + // setInterval(() => { + // if (cluster.isMaster) { + // killOldInvites() + // } + // }, 3600000) + // for (let i = 0; i < numCPUs; i++) { + // cluster.fork(); + // } - cluster.on('exit', (thread, code, signal) => { - console.log(`thread ${thread.process.pid} died`, code, signal) - }); - } else { - rootserver.listen(PORT) - } + // cluster.on('exit', (thread, code, signal) => { + // console.log(`thread ${thread.process.pid} died`, code, signal) + // }); + // } else { + // rootserver.listen(PORT) + // } + rootserver.listen(PORT) }) console.log('SyncLounge WebApp successfully started on port ' + PORT)