fix potential deadlock

This commit is contained in:
Shihao Xia 2021-06-03 21:48:34 -04:00
parent 9d6e5049bb
commit f1c1992f5e

View File

@ -66,7 +66,7 @@ func (r *EtcdMigrateServer) Start(version *EtcdVersion) error {
} }
interval := time.NewTicker(time.Millisecond * 500) interval := time.NewTicker(time.Millisecond * 500)
defer interval.Stop() defer interval.Stop()
done := make(chan bool) done := make(chan bool, 1)
go func() { go func() {
time.Sleep(time.Minute * 2) time.Sleep(time.Minute * 2)
done <- true done <- true