From ea202ccc3f01ac6779830be61dbec49832c7e43c Mon Sep 17 00:00:00 2001 From: dongpd Date: Fri, 9 Jun 2023 11:59:55 +0700 Subject: [PATCH] update file_get_content timeout --- config/params.php | 3 ++- controllers/ApiController.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/params.php b/config/params.php index caf9b4c2..c919a1cc 100644 --- a/config/params.php +++ b/config/params.php @@ -6,5 +6,6 @@ return [ "maxLogs" => 50000, "maxPicture" => 9999, "version" => "1.0.7", - "autoSyncLog" => false + "autoSyncLog" => false, + "timeoutRequestServer" => 10 ]; diff --git a/controllers/ApiController.php b/controllers/ApiController.php index cd32ce85..5510a0f4 100644 --- a/controllers/ApiController.php +++ b/controllers/ApiController.php @@ -109,6 +109,7 @@ class ApiController extends Controller { $text = implode("|", $data); $res = json_decode(@file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([ 'http' => [ + 'timeout' => Yii::$app->params['timeoutRequestServer'], 'header' => "Content-Type: application/json", 'method' => "POST", 'content' => json_encode([