16 lines
411 B
Go
16 lines
411 B
Go
package internal
|
|
|
|
import (
|
|
"net/http"
|
|
"time"
|
|
)
|
|
|
|
func init() {
|
|
/*
|
|
Safety net for 'too many open files' issue on legacy code.
|
|
Set a sane timeout duration for the http.DefaultClient, to ensure idle connections are terminated.
|
|
Reference: https://stackoverflow.com/questions/37454236/net-http-server-too-many-open-files-error
|
|
*/
|
|
http.DefaultClient.Timeout = time.Minute * 5 // Default TCP timeout
|
|
}
|