Skip to content

Commit

Permalink
fix timeout bug
Browse files Browse the repository at this point in the history
  • Loading branch information
justxuewei committed Jun 12, 2021
1 parent 07ef934 commit 29b7f6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/graceful_shutdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ func waitingProcessedTimeout(shutdownConfig *ShutdownConfig) {
if timeout <= 0 {
return
}
start := time.Now()
deadline := time.Now().Add(timeout)

for time.Now().After(start.Add(timeout)) && !shutdownConfig.RequestsFinished {
for time.Now().Before(deadline) && !shutdownConfig.RequestsFinished {
// sleep 10 ms and then we check it again
time.Sleep(10 * time.Millisecond)
}
Expand Down

0 comments on commit 29b7f6d

Please sign in to comment.