Skip to content

Commit 750dd2c

Browse files
committed
server: prioritize quit signal on waitForReady
1 parent 76063b9 commit 750dd2c

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

server.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,11 +702,16 @@ func (s *Server) waitForReady() error {
702702
// this part of the code, the called component will handle the quit
703703
// signal.
704704
select {
705-
case <-s.ready:
706-
return nil
707-
708705
case <-s.quit:
709706
return fmt.Errorf("tapd is shutting down")
707+
708+
default:
709+
select {
710+
case <-s.ready:
711+
return nil
712+
case <-s.quit:
713+
return fmt.Errorf("tapd is shutting down")
714+
}
710715
}
711716
}
712717

0 commit comments

Comments
 (0)