mirror of https://github.com/gofiber/fiber.git
parent
3bffdac364
commit
5df26c4647
|
@ -29,10 +29,16 @@ func init() { //nolint:gochecknoinits
|
|||
flag.Usage = usage
|
||||
}
|
||||
|
||||
// Child determines if the current environment is a child process
|
||||
// This method can be usefull when Prefork is enabled.
|
||||
func (app *App) Child() bool {
|
||||
return utils.GetArgument(flagChild)
|
||||
}
|
||||
|
||||
// prefork manages child processes to make use of the OS REUSEPORT or REUSEADDR feature
|
||||
func (app *App) prefork(addr string, tlsconfig ...*tls.Config) (err error) {
|
||||
// 👶 child process 👶
|
||||
if utils.GetArgument(flagChild) {
|
||||
if app.Child() {
|
||||
// use 1 cpu core per child process
|
||||
runtime.GOMAXPROCS(1)
|
||||
var ln net.Listener
|
||||
|
|
Loading…
Reference in New Issue