cmd/routed: syncgroup better
This commit is contained in:
parent
cce1197484
commit
b628042e29
|
@ -52,6 +52,7 @@ func main() {
|
|||
}
|
||||
|
||||
wg := &sync.WaitGroup{}
|
||||
wg.Add(3)
|
||||
|
||||
go setupQuic(ctx, wg, s, scfg)
|
||||
go setupTLS(ctx, wg, s, scfg)
|
||||
|
@ -121,7 +122,6 @@ func setupQuic(ctx context.Context, wg *sync.WaitGroup, s *Server, scfg Config)
|
|||
s.QuicServer = qs
|
||||
|
||||
go ln.FatalErr(context.Background(), qs.ListenAndServe())
|
||||
wg.Add(1)
|
||||
|
||||
for {
|
||||
select {
|
||||
|
@ -152,7 +152,6 @@ func setupTLS(ctx context.Context, wg *sync.WaitGroup, s *Server, scfg Config) {
|
|||
}
|
||||
|
||||
go ln.FatalErr(context.Background(), hs.ListenAndServeTLS("", ""))
|
||||
wg.Add(1)
|
||||
|
||||
for {
|
||||
select {
|
||||
|
|
Loading…
Reference in New Issue