lib/nat: Don't hang on draining timer chan (fixes #6908) (#6912)

This commit is contained in:
Simon Frei
2020-08-19 15:58:44 +01:00
committed by GitHub
parent cbbc262161
commit ce4d149bf5
+4 -1
View File
@@ -85,7 +85,10 @@ func (s *Service) serve(ctx context.Context) {
case <-timer.C:
case <-s.processScheduled:
if !timer.Stop() {
<-timer.C
select {
case <-timer.C:
default:
}
}
case <-ctx.Done():
timer.Stop()