Introduce welcome message and change default timeout

The welcome message shows the difference between
Pro and CE.

The timeout of 8 seconds was never going to be useful as
a default, so changing to 60 seconds.

Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alex@openfaas.com>
This commit is contained in:
Alex Ellis (OpenFaaS Ltd)
2022-08-30 14:00:00 +01:00
parent 9fccc67b9c
commit 4604271076
4 changed files with 19 additions and 20 deletions

View File

@ -59,7 +59,7 @@ func (ReadConfig) Read(hasEnv HasEnv) (*GatewayConfig, error) {
PrometheusPort: 9090,
}
defaultDuration := time.Second * 8
defaultDuration := time.Second * 60
cfg.ReadTimeout = parseIntOrDurationValue(hasEnv.Getenv("read_timeout"), defaultDuration)
cfg.WriteTimeout = parseIntOrDurationValue(hasEnv.Getenv("write_timeout"), defaultDuration)

View File

@ -198,13 +198,16 @@ func TestRead_EmptyTimeoutConfig(t *testing.T) {
config, _ := readConfig.Read(defaults)
if (config.ReadTimeout) != time.Duration(8)*time.Second {
t.Log("ReadTimeout incorrect")
t.Fail()
want := time.Second * 60
got := config.ReadTimeout
if got != want {
t.Fatalf("config.ReadTimeout want: %s, but got: %s", want, got)
}
if (config.WriteTimeout) != time.Duration(8)*time.Second {
t.Log("WriteTimeout incorrect")
t.Fail()
want = time.Second * 60
got = config.WriteTimeout
if got != want {
t.Fatalf("config.WriteTimeout want: %s, but got: %s", want, got)
}
}