listen: Only error out if not able to bind any interface (#17353)

This commit is contained in:
Anis Eleuch
2023-06-12 17:09:28 +01:00
committed by GitHub
parent be45ffd8a4
commit bb24346e04
4 changed files with 108 additions and 107 deletions

View File

@@ -612,7 +612,14 @@ func serverMain(ctx *cli.Context) {
httpServer.TCPOptions.Trace = bootstrapTrace
go func() {
globalHTTPServerErrorCh <- httpServer.Start(GlobalContext)
serveFn, err := httpServer.Init(GlobalContext, func(listenAddr string, err error) {
logger.LogIf(GlobalContext, fmt.Errorf("Unable to listen on `%s`: %v", listenAddr, err))
})
if err != nil {
globalHTTPServerErrorCh <- err
return
}
globalHTTPServerErrorCh <- serveFn()
}()
bootstrapTrace("setHTTPServer")