We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9638fba commit 10048ceCopy full SHA for 10048ce
1 file changed
server.go
@@ -113,7 +113,9 @@ func (s *Server) Serve(ctx context.Context, l net.Listener) error {
113
backoff *= 2
114
}
115
116
- backoff = min(time.Second, backoff)
+ if max := time.Second; backoff > max {
117
+ backoff = max
118
+ }
119
120
sleep := time.Duration(rand.Int63n(int64(backoff)))
121
log.G(ctx).WithError(err).Errorf("ttrpc: failed accept; backoff %v", sleep)
@@ -558,7 +560,7 @@ func (c *serverConn) run(sctx context.Context) {
558
560
return
559
561
562
log.G(ctx).WithError(err).Error("error receiving message")
- // else, initiate shutdown
563
+ return
564
case <-shutdown:
565
566
0 commit comments