Set write timeout to 500ms as Firefox recommends
/ docker (push) Successful in 1m3s Details

This commit is contained in:
Maxim Lebedev 2023-11-08 02:34:30 +06:00
parent aaba6edc39
commit 353704a09d
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 4 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import (
"runtime" "runtime"
"runtime/pprof" "runtime/pprof"
"syscall" "syscall"
"time"
"github.com/caarlos0/env/v10" "github.com/caarlos0/env/v10"
@ -45,8 +46,9 @@ func main() {
Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { Handler: http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
fmt.Fprintln(w, "hello, world!") fmt.Fprintln(w, "hello, world!")
}), }),
ErrorLog: logger, ErrorLog: logger,
BaseContext: func(ln net.Listener) context.Context { return ctx }, BaseContext: func(ln net.Listener) context.Context { return ctx },
WriteTimeout: 500 * time.Millisecond,
} }
done := make(chan os.Signal, 1) done := make(chan os.Signal, 1)