diff --git a/src/Controller/ApiController.php b/src/Controller/ApiController.php index 023b354..d90a22b 100644 --- a/src/Controller/ApiController.php +++ b/src/Controller/ApiController.php @@ -41,7 +41,7 @@ class ApiController } curl_setopt(handle: $curl, option: CURLOPT_RETURNTRANSFER, value: 1); - curl_setopt(handle: $curl, option: CURLOPT_TIMEOUT_MS, value: 3000); + curl_setopt(handle: $curl, option: CURLOPT_TIMEOUT_MS, value: 19999); curl_setopt(handle: $curl, option: CURLOPT_HTTP_VERSION, value: CURL_HTTP_VERSION_2TLS); if ($versionIP == 4) { @@ -91,11 +91,16 @@ class ApiController $error = true; $result = curl_error(handle: $curl); } + + $info = curl_getinfo(handle: $curl); + $responseTime = $info['total_time']; + curl_close(handle: $curl); return [ - 'error' => $error, - 'data' => $result, - 'header' => $httpResponse ?? '' + 'responseTime' => $responseTime, + 'error' => $error, + 'data' => $result, + 'header' => $httpResponse ?? '' ]; }