mirror of
https://github.com/nabbar/golib.git
synced 2025-12-24 11:51:02 +08:00
- Fix some lint, style, error
- Pkg Error : change the register part to allow identify if a code is free or still defined - Pkg Error : apply change of register into all modules - Make some optimization
This commit is contained in:
@@ -32,8 +32,15 @@ const (
|
||||
EMPTY_PARAMS errors.CodeError = iota + errors.MIN_PKG_Httpserver
|
||||
)
|
||||
|
||||
var isCodeError = false
|
||||
|
||||
func IsCodeError() bool {
|
||||
return isCodeError
|
||||
}
|
||||
|
||||
func init() {
|
||||
errors.RegisterFctMessage(getMessage)
|
||||
isCodeError = errors.ExistInMapMessage(EMPTY_PARAMS)
|
||||
errors.RegisterIdFctMessage(EMPTY_PARAMS, getMessage)
|
||||
}
|
||||
|
||||
func getMessage(code errors.CodeError) (message string) {
|
||||
|
||||
@@ -246,7 +246,7 @@ func (srv *modelServer) Restart() {
|
||||
func (srv *modelServer) Shutdown() {
|
||||
InfoLevel.Logf("Shutdown Server '%s'...", srv.addr.Host)
|
||||
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||
ctx, cancel := context.WithTimeout(context.Background(), TIMEOUT_10_SEC)
|
||||
defer cancel()
|
||||
|
||||
if srv.srv == nil {
|
||||
|
||||
Reference in New Issue
Block a user