mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
if host has 1 cpu (staging) then set availableWorkingCpus to 1
This commit is contained in:
parent
1af44b32b3
commit
a7623bf0d2
1 changed files with 6 additions and 1 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue