Skip to content

Commit

Permalink
Remove prefix of 'function' from timeout warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <han@openfaas.com>
  • Loading branch information
welteki authored and alexellis committed Sep 6, 2022
1 parent ed9bfe7 commit 69b3faf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -519,20 +519,20 @@ Features detected:
if len(fn.Timeout.ReadTimeout) == 0 {
fmt.Printf("⚠️ %s read_timeout is not set\n", fn.Name)
} else if fn.Timeout.GetReadTimeout() > gwUpstreamTimeout {
fmt.Printf("⚠️ function %s read_timeout (%s) is greater than gateway.upstream_timeout (%s)\n", fn.Name, fn.Timeout.ReadTimeout, gwUpstreamTimeout)
fmt.Printf("⚠️ %s read_timeout (%s) is greater than gateway.upstream_timeout (%s)\n", fn.Name, fn.Timeout.ReadTimeout, gwUpstreamTimeout)
}

if len(fn.Timeout.WriteTimeout) == 0 {
fmt.Printf("⚠️ %s write_timeout is not set\n", fn.Name)
} else if fn.Timeout.GetWriteTimeout() > gwUpstreamTimeout {
fmt.Printf("⚠️ function %s write_timeout (%s) is greater than gateway.upstream_timeout (%s)\n", fn.Name, fn.Timeout.WriteTimeout, gwUpstreamTimeout)
fmt.Printf("⚠️ %s write_timeout (%s) is greater than gateway.upstream_timeout (%s)\n", fn.Name, fn.Timeout.WriteTimeout, gwUpstreamTimeout)
}

execTimeout, err := fn.Timeout.GetAdditionalTimeout("exec_timeout")
if err != nil {
fmt.Printf("⚠️ %s exec_timeout is not set\n", fn.Name)
} else if execTimeout > gwUpstreamTimeout {
fmt.Printf("⚠️ function %s exec_timeout (%s) is greater than gateway.upstream_timeout (%s)\n", fn.Name, execTimeout, gwUpstreamTimeout)
fmt.Printf("⚠️ %s exec_timeout (%s) is greater than gateway.upstream_timeout (%s)\n", fn.Name, execTimeout, gwUpstreamTimeout)
}

if fn.Requests.Memory == "0" {
Expand Down

0 comments on commit 69b3faf

Please sign in to comment.