mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
can not break out of for-select block
Signed-off-by: divinerapier <poriter.coco@gmail.com>
This commit is contained in:
parent
9711a6ffaa
commit
5656d43264
|
@ -35,13 +35,12 @@ func batchVacuumVolumeCheck(grpcDialOption grpc.DialOption, vl *VolumeLayout, vi
|
||||||
}(index, dn.Url(), vid)
|
}(index, dn.Url(), vid)
|
||||||
}
|
}
|
||||||
isCheckSuccess := true
|
isCheckSuccess := true
|
||||||
for _ = range locationlist.list {
|
for range locationlist.list {
|
||||||
select {
|
select {
|
||||||
case canVacuum := <-ch:
|
case canVacuum := <-ch:
|
||||||
isCheckSuccess = isCheckSuccess && canVacuum
|
isCheckSuccess = isCheckSuccess && canVacuum
|
||||||
case <-time.After(30 * time.Minute):
|
case <-time.After(30 * time.Minute):
|
||||||
isCheckSuccess = false
|
return false
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return isCheckSuccess
|
return isCheckSuccess
|
||||||
|
@ -71,13 +70,12 @@ func batchVacuumVolumeCompact(grpcDialOption grpc.DialOption, vl *VolumeLayout,
|
||||||
}(index, dn.Url(), vid)
|
}(index, dn.Url(), vid)
|
||||||
}
|
}
|
||||||
isVacuumSuccess := true
|
isVacuumSuccess := true
|
||||||
for _ = range locationlist.list {
|
for range locationlist.list {
|
||||||
select {
|
select {
|
||||||
case canCommit := <-ch:
|
case canCommit := <-ch:
|
||||||
isVacuumSuccess = isVacuumSuccess && canCommit
|
isVacuumSuccess = isVacuumSuccess && canCommit
|
||||||
case <-time.After(30 * time.Minute):
|
case <-time.After(30 * time.Minute):
|
||||||
isVacuumSuccess = false
|
return false
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return isVacuumSuccess
|
return isVacuumSuccess
|
||||||
|
|
Loading…
Reference in a new issue