Skip to content

Commit 123e947

Browse files
author
yangsen
committed
RegionGroup isValid: all regions must be valid
1 parent 9635e1b commit 123e947

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/main/java/com/qiniu/storage/RegionGroup.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,18 @@ Region getCurrentRegion(RegionReqInfo regionReqInfo, int actionType) {
117117

118118
@Override
119119
boolean isValid() {
120-
if (currentRegion == null) {
120+
if (regionList.size() == 0) {
121121
return false;
122122
}
123-
// 只判断当前的
124-
return currentRegion.isValid();
123+
124+
boolean valid = true;
125+
for (Region region : regionList) {
126+
if (region == null || !region.isValid()) {
127+
valid = false;
128+
break;
129+
}
130+
}
131+
return valid;
125132
}
126133

127134
private void updateCurrentRegion() {

0 commit comments

Comments
 (0)