Files
fn-serverless/api/runnerpool/placer_config.go
Tolga Ceylan 9f29d824d6 fn: New timeout for LB Placer (#1137)
* fn: New timeout for LB Placer

Previously, LB Placers worked hard as long as
client contexts allowed for. Adding a Placer
config setting to bound this by 360 seconds by
default.

The new timeout is not accounted during actual
function execution and only applies to the amount
of wait time in Placers when the call is not
being executed.
2018-07-26 10:19:25 -07:00

22 lines
509 B
Go

package runnerpool
import (
"time"
)
// Common config for placers.
type PlacerConfig struct {
// After all runners in the runner list is tried, apply a delay before retrying.
RetryAllDelay time.Duration `json:"retry_all_delay"`
// Maximum amount of time a placer can hold a request during runner attempts
PlacerTimeout time.Duration `json:"placer_timeout"`
}
func NewPlacerConfig() PlacerConfig {
return PlacerConfig{
RetryAllDelay: 10 * time.Millisecond,
PlacerTimeout: 360 * time.Second,
}
}