Browse Source

Merge pull request #1129 from divinerapier/master

can not break out of from for-select block
pull/1135/head
Chris Lu 5 years ago
committed by GitHub
parent
commit
4f3adcb5ab
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      weed/topology/topology_vacuum.go

10
weed/topology/topology_vacuum.go

@ -35,13 +35,12 @@ func batchVacuumVolumeCheck(grpcDialOption grpc.DialOption, vl *VolumeLayout, vi
}(index, dn.Url(), vid)
}
isCheckSuccess := true
for _ = range locationlist.list {
for range locationlist.list {
select {
case canVacuum := <-ch:
isCheckSuccess = isCheckSuccess && canVacuum
case <-time.After(30 * time.Minute):
isCheckSuccess = false
break
return false
}
}
return isCheckSuccess
@ -71,13 +70,12 @@ func batchVacuumVolumeCompact(grpcDialOption grpc.DialOption, vl *VolumeLayout,
}(index, dn.Url(), vid)
}
isVacuumSuccess := true
for _ = range locationlist.list {
for range locationlist.list {
select {
case canCommit := <-ch:
isVacuumSuccess = isVacuumSuccess && canCommit
case <-time.After(30 * time.Minute):
isVacuumSuccess = false
break
return false
}
}
return isVacuumSuccess

Loading…
Cancel
Save