Configurable function level timeout (#1284)
This commit is contained in:
@@ -19,6 +19,7 @@ package v1
|
||||
const (
|
||||
EXECUTOR_INSTANCEID_LABEL string = "executorInstanceId"
|
||||
POOLMGR_INSTANCEID_LABEL string = "poolmgrInstanceId"
|
||||
DEFAULT_FUNCTION_TIMEOUT int = 60
|
||||
)
|
||||
|
||||
const (
|
||||
|
||||
@@ -337,6 +337,10 @@ type (
|
||||
|
||||
// InvokeStrategy is a set of controls which affect how function executes
|
||||
InvokeStrategy InvokeStrategy
|
||||
|
||||
// FunctionTimeout provides a maximum amount of duration wihtin which a request for a particular function execution should be complete.
|
||||
// This is optional. If not specified default value will be taken as 60s
|
||||
FunctionTimeout int `json:"functionTimeout,omitempty"`
|
||||
}
|
||||
|
||||
// InvokeStrategy is a set of controls over how the function executes.
|
||||
|
||||
@@ -304,6 +304,11 @@ func (spec FunctionSpec) Validate() error {
|
||||
result = multierror.Append(result, spec.InvokeStrategy.Validate())
|
||||
}
|
||||
|
||||
// TODO Add below validation warning
|
||||
/*if spec.FunctionTimeout <= 0 {
|
||||
result = multierror.Append(result, MakeValidationErr(ErrorInvalidValue, "FunctionTimeout value", spec.FunctionTimeout, "not a valid value. Should always be more than 0"))
|
||||
}*/
|
||||
|
||||
return result.ErrorOrNil()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user