if host has 1 cpu (staging) then set availableWorkingCpus to 1
This commit is contained in:
@@ -176,7 +176,12 @@ server = net.createServer (socket) ->
|
|||||||
socket.destroy()
|
socket.destroy()
|
||||||
|
|
||||||
currentLoad = os.loadavg()[0]
|
currentLoad = os.loadavg()[0]
|
||||||
availableWorkingCpus = os.cpus().length - 1
|
|
||||||
|
if os.cpus().length == 1
|
||||||
|
availableWorkingCpus = 1
|
||||||
|
else
|
||||||
|
availableWorkingCpus = os.cpus().length - 1
|
||||||
|
|
||||||
freeLoad = availableWorkingCpus - currentLoad
|
freeLoad = availableWorkingCpus - currentLoad
|
||||||
freeLoadPercentage = Math.round((freeLoad / availableWorkingCpus) * 100)
|
freeLoadPercentage = Math.round((freeLoad / availableWorkingCpus) * 100)
|
||||||
if freeLoadPercentage <= 0
|
if freeLoadPercentage <= 0
|
||||||
|
|||||||
Reference in New Issue
Block a user