Fix parallelization
This commit is contained in:
parent
bbc25e9aec
commit
906a0ab888
@ -980,12 +980,12 @@ trait PeerHandler
|
|||||||
return $promises;
|
return $promises;
|
||||||
}
|
}
|
||||||
|
|
||||||
$yielded = yield Tools::all($promises);
|
$yielded = [...yield Tools::all($promises)];
|
||||||
while ($yielded) {
|
while ($yielded) {
|
||||||
$newYielded = [];
|
$newYielded = [];
|
||||||
|
|
||||||
foreach (\array_chunk([...$yielded], 10) as $promises) {
|
foreach (\array_chunk($yielded, 10) as $promises) {
|
||||||
$newYielded = \array_merge(yield Tools::all($promises), $newYielded);
|
$newYielded = \array_merge($newYielded, ...(yield Tools::all($promises)));
|
||||||
}
|
}
|
||||||
|
|
||||||
$yielded = $newYielded;
|
$yielded = $newYielded;
|
||||||
|
Loading…
Reference in New Issue
Block a user