From 221daaacac36c31e8427f4db693ac28ad928e769 Mon Sep 17 00:00:00 2001 From: Alex Cabal Date: Sat, 25 Jan 2025 11:29:18 -0600 Subject: [PATCH] Increase wait time when fetching project updated timestamps, and improve error messages --- lib/Project.php | 8 ++++---- scripts/update-project-statuses | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Project.php b/lib/Project.php index 414f4ea3..87bf7f72 100644 --- a/lib/Project.php +++ b/lib/Project.php @@ -554,11 +554,11 @@ final class Project{ $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); 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){ - throw new Exception('HTTP code ' . $httpCode . ' received for URL <' . $url . '>.'); + throw new Exception('Server responded with HTTP ' . $httpCode . '.'); } /** @var array $commits */ @@ -590,11 +590,11 @@ final class Project{ $httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); 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){ - throw new Exception('HTTP code ' . $httpCode . ' received for URL <' . $this->DiscussionUrl . '>.'); + throw new Exception('Server responded with HTTP ' . $httpCode . '.'); } $matchCount = preg_match_all('/([a-z]{3} [\d]{1,2}, [\d]{4}, [\d]{1,2}:[\d]{1,2}:[\d]{1,2} (?:AM|PM))/iu', $response, $matches); diff --git a/scripts/update-project-statuses b/scripts/update-project-statuses index 916082a4..68ff2109 100755 --- a/scripts/update-project-statuses +++ b/scripts/update-project-statuses @@ -89,5 +89,5 @@ foreach($projects as $project){ $project->Save(); - sleep(1); + sleep(5); }