feat: cluster implementation

This commit is contained in:
NGPixel
2017-07-29 00:11:22 -04:00
parent 60750eeed8
commit 9c112ab535
15 changed files with 414 additions and 564 deletions

View File

@@ -2,12 +2,10 @@
/* global wiki */
module.exports = (processName) => {
let winston = require('winston')
const cluster = require('cluster')
if (typeof processName === 'undefined') {
processName = 'SERVER'
}
module.exports = () => {
let winston = require('winston')
// Console
@@ -25,6 +23,7 @@ module.exports = (processName) => {
})
logger.filters.push((level, msg) => {
let processName = (cluster.isMaster) ? 'MASTER' : `WORKER-${cluster.worker.id}`
return '[' + processName + '] ' + msg
})