Initial Codebase (untested)
This commit is contained in:
15
internal/init.go
Normal file
15
internal/init.go
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user