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