Skip to content

Commit

Permalink
Merge branch 'hotfix/0.4.0.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
Ne-Lexa committed Oct 3, 2022
2 parents 0cbe6d2 + d65691a commit dcb6486
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/GPlayApps.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

namespace Nelexa\GPlay;

use GuzzleHttp\Exception\RequestException;
use GuzzleHttp\Promise\EachPromise;
use GuzzleHttp\Promise\FulfilledPromise;
use GuzzleHttp\Psr7\Query;
Expand Down Expand Up @@ -1093,14 +1094,21 @@ protected function fetchAppsFromClusterPages($category, ?Enum\AgeEnum $age, int
$apps = [];
$count = 0;
foreach ($this->getClusterPages($category, $age) as $clusterPage) {
foreach ($this->getClusterApps($clusterPage->getUrl()) as $app) {
if (!isset($apps[$app->getId()])) {
$apps[$app->getId()] = $app;
++$count;
if ($count === $limit) {
break 2;
try {
foreach ($this->getClusterApps($clusterPage->getUrl()) as $app) {
if (!isset($apps[$app->getId()])) {
$apps[$app->getId()] = $app;
++$count;
if ($count === $limit) {
break 2;
}
}
}
} catch (RequestException $e) {
$response = $e->getResponse();
if ($response === null || $response->getStatusCode() !== 404) {
throw $e;
}
}
}

Expand Down

0 comments on commit dcb6486

Please sign in to comment.