Skip to content

Commit

Permalink
Merge branch 'region-create-by-region-id' into uc-query-disk-cache
Browse files Browse the repository at this point in the history
  • Loading branch information
YangSen-qn committed Nov 6, 2023
2 parents a73fb17 + 34fbd2c commit d389e5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/main/java/com/qiniu/storage/Region.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,14 @@ public static Region regionAs0() {
* @return Region 实例
*/
public static Region createWithRegionId(String regionId) {
if (regionId == null || regionId.isEmpty()) {
return null;
}

if (regionId.equals("z0")) {
return Region.region0();
}

return new Builder()
.region(regionId)
.srcUpHost("up-" + regionId + ".qiniup.com")
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/test/com/qiniu/storage/BucketTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -1331,7 +1331,7 @@ public void testBatchStat() throws Exception {
public void testFile(TestConfig.TestFile file, BucketManager bucketManager) throws IOException {
String bucket = file.getBucketName();
String key = file.getKey();
String[] keyArray = new String[100];
String[] keyArray = new String[50];
for (int i = 0; i < keyArray.length; i++) {
keyArray[i] = key;
}
Expand Down

0 comments on commit d389e5c

Please sign in to comment.