mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-16 21:56:40 -05:00
caddy: Start all servers only after all listeners successful (#2508)
This commit is contained in:
parent
47b78714b8
commit
397d67876c
1 changed files with 5 additions and 3 deletions
8
caddy.go
8
caddy.go
|
@ -781,6 +781,10 @@ func startServers(serverList []Server, inst *Instance, restartFds map[string]res
|
|||
}
|
||||
}
|
||||
|
||||
inst.servers = append(inst.servers, ServerListener{server: s, listener: ln, packet: pc})
|
||||
}
|
||||
|
||||
for _, s := range inst.servers {
|
||||
inst.wg.Add(2)
|
||||
stopWg.Add(2)
|
||||
func(s Server, ln net.Listener, pc net.PacketConn, inst *Instance) {
|
||||
|
@ -799,9 +803,7 @@ func startServers(serverList []Server, inst *Instance, restartFds map[string]res
|
|||
}()
|
||||
errChan <- s.ServePacket(pc)
|
||||
}()
|
||||
}(s, ln, pc, inst)
|
||||
|
||||
inst.servers = append(inst.servers, ServerListener{server: s, listener: ln, packet: pc})
|
||||
}(s.server, s.listener, s.packet, inst)
|
||||
}
|
||||
|
||||
// Log errors that may be returned from Serve() calls,
|
||||
|
|
Loading…
Reference in a new issue