diff --git a/syncs/watchdog.go b/syncs/watchdog.go index f4042644d..6af07c53c 100644 --- a/syncs/watchdog.go +++ b/syncs/watchdog.go @@ -29,7 +29,10 @@ func Watch(ctx context.Context, mu sync.Locker, tick, max time.Duration) chan ti // Drop values written after c is closed. return } - c <- d + select { + case c <- d: + case <-ctx.Done(): + } } closec := func() { closemu.Lock()