mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-25 08:38:09 -05:00
15 lines
445 B
CoffeeScript
15 lines
445 B
CoffeeScript
|
cluster = require 'cluster'
|
||
|
numCPUs = require('os').cpus().length
|
||
|
|
||
|
if cluster.isMaster
|
||
|
for i in [0...numCPUs]
|
||
|
cluster.fork()
|
||
|
cluster.on 'exit', (worker, code, signal) ->
|
||
|
console.log 'worker' + worker.process.id + 'died'
|
||
|
cluster.fork()
|
||
|
else
|
||
|
require('coffee-script')
|
||
|
require('coffee-script/register')
|
||
|
server = require('./server')
|
||
|
server.startServer()
|