From e8fe859a58dee7172a29236c74c01e290b9a47ad Mon Sep 17 00:00:00 2001 From: nkbai Date: Wed, 9 Dec 2015 09:03:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- grace/grace.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/grace/grace.go b/grace/grace.go index 40eef144..355e5d1a 100644 --- a/grace/grace.go +++ b/grace/grace.go @@ -53,18 +53,18 @@ import ( ) const ( - // PreSignal is the position to add filter before signal +// PreSignal is the position to add filter before signal PreSignal = iota - // PostSignal is the position to add filter after signal +// PostSignal is the position to add filter after signal PostSignal - // StateInit represent the application inited +// StateInit represent the application inited StateInit - // StateRunning represent the application is running +// StateRunning represent the application is running StateRunning - // StateShuttingDown represent the application is shutting down +// StateShuttingDown represent the application is shutting down StateShuttingDown - // StateTerminate represent the application is killed +// StateTerminate represent the application is killed StateTerminate ) @@ -75,25 +75,25 @@ var ( socketPtrOffsetMap map[string]uint runningServersForked bool - // DefaultReadTimeOut is the HTTP read timeout +// DefaultReadTimeOut is the HTTP read timeout DefaultReadTimeOut time.Duration - // DefaultWriteTimeOut is the HTTP Write timeout +// DefaultWriteTimeOut is the HTTP Write timeout DefaultWriteTimeOut time.Duration - // DefaultMaxHeaderBytes is the Max HTTP Herder size, default is 0, no limit +// DefaultMaxHeaderBytes is the Max HTTP Herder size, default is 0, no limit DefaultMaxHeaderBytes int - // DefaultTimeout is the shutdown server's timeout. default is 60s +// DefaultTimeout is the shutdown server's timeout. default is 60s DefaultTimeout time.Duration - isChild bool + isChild bool socketOrder string - once sync.Once=sync.Once{} + once sync.Once ) func init() { DefaultMaxHeaderBytes = 0 DefaultTimeout = 60 * time.Second } -func onceInit(){ +func onceInit() { regLock = &sync.Mutex{} flag.BoolVar(&isChild, "graceful", false, "listen on open fd (after forking)") flag.StringVar(&socketOrder, "socketorder", "", "previous initialization order - used when more than one listener was started")