fix Curl::load timeout error
This commit is contained in:
1 parent
30003b7d3d
commit
c3c8f6a393
7 files changed
+18
-6
No files matched your search
@@ -70,7 +70,7 @@ class Curl
|
||||
public static function fetch_data_with_retries($url, $_config = [], $max_retries = 3)
|
||||
{
|
||||
$attempt = 0;
|
||||
$timeout = 10; // seconds
|
||||
$timeout = 5; // seconds
|
||||
$connect_timeout = 5; // seconds
|
||||
|
||||
$debug = Nuh::$options['d'] ?? 0;
|
||||
@@ -136,7 +136,7 @@ class Curl
|
||||
echo "All attempts failed.\n";
|
||||
curl_close($ch);
|
||||
|
||||
return null; // Return null if all retries fail
|
||||
return json_encode(['no data']); // Return null if all retries fail
|
||||
}
|
||||
|
||||
public static function curlerrorcode($id)
|
||||
|
||||
Reference in new issue
Block a user