diff --git a/app/modules_app/voice/transcribe.php b/app/modules_app/voice/transcribe.php index 67b5a30..2cf0c21 100644 --- a/app/modules_app/voice/transcribe.php +++ b/app/modules_app/voice/transcribe.php @@ -13,6 +13,8 @@ declare(strict_types=1); +set_time_limit(90); + use App\Core\Database; use App\Core\Encryption; use App\Middleware\AuthMiddleware; @@ -237,7 +239,7 @@ function callGeminiGenerateContent(string $model, array $payload, string $apiKey 'Content-Type: application/json', 'x-goog-api-key: ' . $apiKey, ], - CURLOPT_TIMEOUT => 45, + CURLOPT_TIMEOUT => 60, ]); $response = curl_exec($ch); @@ -245,6 +247,10 @@ function callGeminiGenerateContent(string $model, array $payload, string $apiKey $error = curl_error($ch); curl_close($ch); + if ($httpCode !== 200) { + error_log("Gemini API Call Failed: HTTP $httpCode | Error: $error | URL: $url"); + } + return [ 'body' => is_string($response) ? $response : '', 'http_code' => (int)$httpCode, diff --git a/musadaq-app/lib/core/network/dio_client.dart b/musadaq-app/lib/core/network/dio_client.dart index 8a14c0c..179fffb 100644 --- a/musadaq-app/lib/core/network/dio_client.dart +++ b/musadaq-app/lib/core/network/dio_client.dart @@ -10,8 +10,8 @@ class DioClient { dio = Dio( BaseOptions( baseUrl: baseUrl, - connectTimeout: const Duration(seconds: 15), - receiveTimeout: const Duration(seconds: 15), + connectTimeout: const Duration(seconds: 60), + receiveTimeout: const Duration(seconds: 60), headers: { 'Content-Type': 'application/json', 'Accept': 'application/json',