fix Curl::load timeout error

This commit is contained in:
salam committed 2026-01-17 15:20:51 +01:00
1 parent 30003b7d3d
commit c3c8f6a393
7 files changed
+18 -6

No files matched your search

+2 -2
View File
@@ -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)
@@ -36,6 +36,10 @@ class Bwin
$data = Curl::load($url);
if (! isset($data['pager'])) {
return;
}
$total = round($data['pager']['total'] / $data['pager']['per_page']);
if ($debug) {
@@ -58,6 +58,10 @@ class Fixtures
$data = Curl::load($url);
if (! isset($data['pager'])) {
return;
}
$page++;
if (isset($data['pager']['total'])) {
@@ -74,6 +74,10 @@ class Fixtures
$data = Curl::load($url);
if (! count($data)) {
return;
}
foreach ($data as $magloo) {
// print_r($magloo);
@@ -3,7 +3,7 @@
@endphp
@if (isset($icon))
<div class="h-3 m-0 bg-cover bg-center bg-no-repeat my-auto dark:opacity-80" title="{{ $bookmaker_id }}"
<div class="h-3 m-0 bg-contain bg-center bg-no-repeat my-auto dark:opacity-80" title="{{ $bookmaker_id }}"
style="background-image: url('{{ BkmIconMap::get($icon) }}')">
</div>
@endif
@@ -1,10 +1,10 @@
<div>Bookmaker</div>
<div>Book</div>
@foreach ($labels as $label)
<div>{{ $label }}</div>
@endforeach
<div>Margin</div>
<div></div>
<div>Bookmaker</div>
<div>Book</div>
@foreach ($labels as $label)
<div>{{ $label }}</div>
@endforeach
@@ -3,7 +3,7 @@
@endphp
@if (isset($icon))
<div class="h-4 m-0 bg-contain bg-no-repeat my-auto dark:opacity-80" title="{{ $bookmaker_id }}"
<div class="h-4 m-0 bg-contain bg-center bg-no-repeat my-auto dark:opacity-80" title="{{ $bookmaker_id }}"
style="background-image: url('{{ BkmIconMap::get($icon) }}')">
</div>
@endif