Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

Commit 431dc28

Browse files
committed
🐛 主控返回空节点导致报错
1 parent 20a2b7b commit 431dc28

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

inc/cluster.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ private function downloader(Swoole\Coroutine\Http\Client $client, $file,$bar) {
133133
mlog("Error connecting to the main control:{$client->errMsg}",2);
134134
return false;
135135
} else {
136+
if(isset($client->getHeaders()['location'])){
136137
$location_url = parse_url($client->getHeaders()['location']);
137138
$client->close();
138139
$client = new Swoole\Coroutine\Http\Client($location_url['host'], $location_url['port'], true);
@@ -189,6 +190,11 @@ private function downloader(Swoole\Coroutine\Http\Client $client, $file,$bar) {
189190
}
190191
}
191192
}
193+
else{
194+
$bar->progress();
195+
return false;
196+
}
197+
}
192198
}
193199

194200
public function downloadFiles() {

0 commit comments

Comments
 (0)