mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 23:30:35 -04:00
Increase wait time when fetching project updated timestamps, and improve error messages
This commit is contained in:
parent
2aaa1e301f
commit
221daaacac
2 changed files with 5 additions and 5 deletions
|
@ -554,11 +554,11 @@ final class Project{
|
||||||
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||||
|
|
||||||
if(!is_string($response)){
|
if(!is_string($response)){
|
||||||
throw new Exceptions\AppException('Response from <' . $url . '> was not a string: ' . $response);
|
throw new Exceptions\AppException('Server did not respond with a string: ' . $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($httpCode != Enums\HttpCode::Ok->value){
|
if($httpCode != Enums\HttpCode::Ok->value){
|
||||||
throw new Exception('HTTP code ' . $httpCode . ' received for URL <' . $url . '>.');
|
throw new Exception('Server responded with HTTP ' . $httpCode . '.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @var array<stdClass> $commits */
|
/** @var array<stdClass> $commits */
|
||||||
|
@ -590,11 +590,11 @@ final class Project{
|
||||||
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
|
||||||
|
|
||||||
if(!is_string($response)){
|
if(!is_string($response)){
|
||||||
throw new Exceptions\AppException('Response from <' . $this->DiscussionUrl . '> was not a string: ' . $response);
|
throw new Exceptions\AppException('Server did not respond with a string: ' . $response);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($httpCode != Enums\HttpCode::Ok->value){
|
if($httpCode != Enums\HttpCode::Ok->value){
|
||||||
throw new Exception('HTTP code ' . $httpCode . ' received for URL <' . $this->DiscussionUrl . '>.');
|
throw new Exception('Server responded with HTTP ' . $httpCode . '.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$matchCount = preg_match_all('/<span class="[^"]+?">([a-z]{3} [\d]{1,2}, [\d]{4}, [\d]{1,2}:[\d]{1,2}:[\d]{1,2} (?:AM|PM))/iu', $response, $matches);
|
$matchCount = preg_match_all('/<span class="[^"]+?">([a-z]{3} [\d]{1,2}, [\d]{4}, [\d]{1,2}:[\d]{1,2}:[\d]{1,2} (?:AM|PM))/iu', $response, $matches);
|
||||||
|
|
|
@ -89,5 +89,5 @@ foreach($projects as $project){
|
||||||
|
|
||||||
$project->Save();
|
$project->Save();
|
||||||
|
|
||||||
sleep(1);
|
sleep(5);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue