mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
enhance(main): ignore net.ErrClosed
This commit is contained in:
parent
3859849bfb
commit
d9433cb00f
2 changed files with 11 additions and 3 deletions
|
@ -33,7 +33,7 @@ delay = 1000 # ms
|
||||||
# Stop running old binary when build errors occur.
|
# Stop running old binary when build errors occur.
|
||||||
stop_on_error = true
|
stop_on_error = true
|
||||||
# Send Interrupt signal before killing process (windows does not support this feature)
|
# Send Interrupt signal before killing process (windows does not support this feature)
|
||||||
send_interrupt = false
|
send_interrupt = true
|
||||||
# Delay after sending Interrupt signal
|
# Delay after sending Interrupt signal
|
||||||
kill_delay = 500 # ms
|
kill_delay = 500 # ms
|
||||||
|
|
||||||
|
|
12
main.go
12
main.go
|
@ -115,8 +115,16 @@ func main() {
|
||||||
Run: Program(confPath),
|
Run: Program(confPath),
|
||||||
Debug: cSettings.ServerSettings.RunMode == gin.DebugMode,
|
Debug: cSettings.ServerSettings.RunMode == gin.DebugMode,
|
||||||
Addresses: []string{fmt.Sprintf("%s:%d", cSettings.ServerSettings.Host, cSettings.ServerSettings.Port)},
|
Addresses: []string{fmt.Sprintf("%s:%d", cSettings.ServerSettings.Host, cSettings.ServerSettings.Port)},
|
||||||
|
ErrorHandler: func(kind string, err error) {
|
||||||
|
if errors.Is(err, net.ErrClosed) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
logger.Error(kind, err)
|
||||||
|
},
|
||||||
})
|
})
|
||||||
if !errors.Is(err, context.DeadlineExceeded) {
|
if !errors.Is(err, context.DeadlineExceeded) &&
|
||||||
logger.Fatal(err)
|
!errors.Is(err, context.Canceled) &&
|
||||||
|
!errors.Is(err, net.ErrClosed) {
|
||||||
|
logger.Error(err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue