Skip to content

Commit ff76348

Browse files
committed
add backup uphost
1 parent 22c9295 commit ff76348

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

src/Qiniu/Storage/ResumeUploader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function upload()
7777
$ret = $response->json();
7878
}
7979
if ($response->statusCode < 0) {
80-
$this->host = Config::UPBACKUP_HOST;
80+
$this->host = $confg::$upBackupHost;
8181
}
8282
if ($response->needRetry() || !isset($ret['crc32']) || $crc != $ret['crc32']) {
8383
$response = $this->makeBlock($data, $blockSize);

src/Qiniu/Zone.php

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,32 @@
44
final class Zone
55
{
66
public static $upHost = 'http://up.qiniu.com';
7+
public static $upBackupHost = 'http://upload.qiniu.com';
78

8-
public function __construct($upHost)
9+
public function __construct()
910
{
10-
$this->upHost = $upHost;
11+
}
12+
13+
public function setUpHost($host)
14+
{
15+
self::$upHost = $host;
16+
}
17+
18+
public function setUpBackupHost($host)
19+
{
20+
self::$upBackupHost = $host;
1121
}
1222

1323
public static function zone0()
1424
{
15-
return new self('http://up.qiniu.com');
25+
return new self;
1626
}
1727

1828
public static function zone1()
1929
{
20-
return new self('http://up-z1.qiniu.com');
30+
$z1 = new self;
31+
$z1->setUpHost('http://up-z1.qiniu.com');
32+
$z1->setUpBackupHost('http://upload-z1.qiniu.com');
33+
return $z1;
2134
}
2235
}

0 commit comments

Comments
 (0)