mirror of
https://github.com/openfaas/faas.git
synced 2025-06-08 16:26:47 +00:00
- this change is needed for Docker Swarm which may give an error when several concurrent requests come in to scale a deployment. Tested on Docker Swarm before/after with the hey tool and figlet scaled down to zero replicas. Signed-off-by: Alex Ellis (VMware) <alexellis2@gmail.com>
26 lines
636 B
Go
26 lines
636 B
Go
package scaling
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// ScalingConfig for scaling behaviours
|
|
type ScalingConfig struct {
|
|
// MaxPollCount attempts to query a function before giving up
|
|
MaxPollCount uint
|
|
|
|
// FunctionPollInterval delay or interval between polling a function's
|
|
// readiness status
|
|
FunctionPollInterval time.Duration
|
|
|
|
// CacheExpiry life-time for a cache entry before considering invalid
|
|
CacheExpiry time.Duration
|
|
|
|
// ServiceQuery queries available/ready replicas for function
|
|
ServiceQuery ServiceQuery
|
|
|
|
// SetScaleRetries is the number of times to try scaling a function before
|
|
// giving up due to errors
|
|
SetScaleRetries uint
|
|
}
|