Skip to content

Commit

Permalink
exponential backoff
Browse files Browse the repository at this point in the history
  • Loading branch information
markhuot committed Nov 15, 2023
1 parent 292a7af commit 82a729f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/services/DataTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public function getRawData($url, $feedId = null): array
}

$tries = 0;
$maxTries = 3;
$maxTries = 10;
while (++$tries <= $maxTries) {

Check failure on line 209 in src/services/DataTypes.php

View workflow job for this annotation

GitHub Actions / ci / Code Quality / PHPStan / PHPStan

Method craft\feedme\services\DataTypes::getRawData() should return array but return statement is missing.
try {
$client = Plugin::$plugin->service->createGuzzleClient($feedId);
Expand Down Expand Up @@ -237,7 +237,7 @@ public function getRawData($url, $feedId = null): array
}
else {
Plugin::info('HTTP error #' . $tries . ' at ' . $url . ', ' . $e->getMessage());
sleep($tries);
sleep(($tries ^ 2) / 2); // wait up to 40.5 seconds on the 9th try
}
}
}
Expand Down

0 comments on commit 82a729f

Please sign in to comment.