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)
|
public static function fetch_data_with_retries($url, $_config = [], $max_retries = 3)
|
||||||
{
|
{
|
||||||
$attempt = 0;
|
$attempt = 0;
|
||||||
$timeout = 10; // seconds
|
$timeout = 5; // seconds
|
||||||
$connect_timeout = 5; // seconds
|
$connect_timeout = 5; // seconds
|
||||||
|
|
||||||
$debug = Nuh::$options['d'] ?? 0;
|
$debug = Nuh::$options['d'] ?? 0;
|
||||||
@@ -136,7 +136,7 @@ class Curl
|
|||||||
echo "All attempts failed.\n";
|
echo "All attempts failed.\n";
|
||||||
curl_close($ch);
|
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)
|
public static function curlerrorcode($id)
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ class Bwin
|
|||||||
|
|
||||||
$data = Curl::load($url);
|
$data = Curl::load($url);
|
||||||
|
|
||||||
|
if (! isset($data['pager'])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$total = round($data['pager']['total'] / $data['pager']['per_page']);
|
$total = round($data['pager']['total'] / $data['pager']['per_page']);
|
||||||
|
|
||||||
if ($debug) {
|
if ($debug) {
|
||||||
|
|||||||
@@ -58,6 +58,10 @@ class Fixtures
|
|||||||
|
|
||||||
$data = Curl::load($url);
|
$data = Curl::load($url);
|
||||||
|
|
||||||
|
if (! isset($data['pager'])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$page++;
|
$page++;
|
||||||
|
|
||||||
if (isset($data['pager']['total'])) {
|
if (isset($data['pager']['total'])) {
|
||||||
|
|||||||
@@ -74,6 +74,10 @@ class Fixtures
|
|||||||
|
|
||||||
$data = Curl::load($url);
|
$data = Curl::load($url);
|
||||||
|
|
||||||
|
if (! count($data)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($data as $magloo) {
|
foreach ($data as $magloo) {
|
||||||
|
|
||||||
// print_r($magloo);
|
// print_r($magloo);
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
@if (isset($icon))
|
@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) }}')">
|
style="background-image: url('{{ BkmIconMap::get($icon) }}')">
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
<div>Bookmaker</div>
|
<div>Book</div>
|
||||||
@foreach ($labels as $label)
|
@foreach ($labels as $label)
|
||||||
<div>{{ $label }}</div>
|
<div>{{ $label }}</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
<div>Margin</div>
|
<div>Margin</div>
|
||||||
<div></div>
|
<div></div>
|
||||||
<div>Bookmaker</div>
|
<div>Book</div>
|
||||||
@foreach ($labels as $label)
|
@foreach ($labels as $label)
|
||||||
<div>{{ $label }}</div>
|
<div>{{ $label }}</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
@if (isset($icon))
|
@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) }}')">
|
style="background-image: url('{{ BkmIconMap::get($icon) }}')">
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
Reference in new issue
Block a user