feat(updater) : WIP awaitAll
This commit is contained in:
parent
587f2fbd51
commit
b439265c25
1 changed files with 3 additions and 4 deletions
|
@ -360,15 +360,14 @@ function searchWikis($path, $pattern)
|
|||
'VERSION' => $wakkaConfig['yeswiki_version'] ?? 'KO',
|
||||
'RELEASE' => $wakkaConfig['yeswiki_release'] ?? 'KO',
|
||||
];
|
||||
//$executions[$nb] = Worker\submit($client->request(new Request($list[$nb]['URL'] . $wakkaConfig['root_page'])));
|
||||
}
|
||||
}
|
||||
try {
|
||||
$responses = Future\await(array_map(function ($l) use ($httpClient) {
|
||||
$responses = Future\awaitAll(array_map(function ($l) use ($httpClient) {
|
||||
return Amp\async(fn () => $httpClient->request(new Request($l['URL'], 'HEAD')));
|
||||
}, $list));
|
||||
|
||||
foreach ($responses as $key => $response) {
|
||||
var_dump($responses[0]);
|
||||
foreach ($responses[1] as $key => $response) {
|
||||
$list[$key]['STATUS'] = $response->getStatus() . ' ' . $response->getReason();
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
|
|
Loading…
Reference in a new issue