mirror of
https://github.com/openfaas/faas.git
synced 2025-06-22 14:53:25 +00:00
Remove the differentiation between currentReplicas==1 and not
Signed-off-by: Gede Wahyu <tokekbesi@gmail.com>
This commit is contained in:
@ -100,14 +100,10 @@ func CalculateReplicas(status string, currentReplicas uint64, maxReplicas uint64
|
|||||||
step := uint64((float64(maxReplicas) / 100) * float64(scalingFactor))
|
step := uint64((float64(maxReplicas) / 100) * float64(scalingFactor))
|
||||||
|
|
||||||
if status == "firing" && step > 0 {
|
if status == "firing" && step > 0 {
|
||||||
if currentReplicas == 1 {
|
if currentReplicas+step > maxReplicas {
|
||||||
newReplicas = step
|
newReplicas = maxReplicas
|
||||||
} else {
|
} else {
|
||||||
if currentReplicas+step > maxReplicas {
|
newReplicas = currentReplicas + step
|
||||||
newReplicas = maxReplicas
|
|
||||||
} else {
|
|
||||||
newReplicas = currentReplicas + step
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else { // Resolved event.
|
} else { // Resolved event.
|
||||||
newReplicas = minReplicas
|
newReplicas = minReplicas
|
||||||
|
Reference in New Issue
Block a user