Skip to content

Commit

Permalink
feat: set 1s limit for graceful shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
rueian committed Jun 13, 2024
1 parent 16d5f13 commit ee7ad88
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,10 @@ func (p *pipe) Close() {
p.background()
}
if block == 1 && (stopping1 || stopping2) { // make sure there is no block cmd
<-p.queue.PutOne(cmds.PingCmd)
select {
case <-p.queue.PutOne(cmds.PingCmd):
case <-time.After(time.Second):
}
}
}
atomic.AddInt32(&p.waits, -1)
Expand Down

0 comments on commit ee7ad88

Please sign in to comment.