fix bug exception get logs
This commit is contained in:
parent
476f01098f
commit
58a5522642
|
@ -107,7 +107,7 @@ class ApiController extends Controller {
|
|||
$data[] = "123"; //person_id
|
||||
$data[] = "+7"; //timezone
|
||||
$text = implode("|", $data);
|
||||
$res = json_decode(file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
|
||||
$res = json_decode(@file_get_contents($ip . "/api/box/face_recognition_auth_v2?token=" . $tk, false, stream_context_create([
|
||||
'http' => [
|
||||
'header' => "Content-Type: application/json",
|
||||
'method' => "POST",
|
||||
|
@ -118,7 +118,7 @@ class ApiController extends Controller {
|
|||
])
|
||||
]
|
||||
])), true);
|
||||
if ($res['status'] == 10000) {
|
||||
if ($res && $res['status'] == 10000) {
|
||||
$logsInfo->sync_status = 1;
|
||||
$logsInfo->save();
|
||||
}
|
||||
|
@ -395,8 +395,10 @@ class ApiController extends Controller {
|
|||
if ($connected) {
|
||||
$is_conn = true; //action when connected
|
||||
fclose($connected);
|
||||
// file_put_contents("log_connect_server.txt", "\n" . date("H:i:s d/m/Y") . " connected " . $host . ":" . $port, FILE_APPEND);
|
||||
} else {
|
||||
$is_conn = false; //action in connection failure
|
||||
// file_put_contents("log_connect_server.txt", "\n" . date("H:i:s d/m/Y") . " disconnected " . $host . ":" . $port, FILE_APPEND);
|
||||
}
|
||||
return $is_conn;
|
||||
}
|
||||
|
@ -491,12 +493,14 @@ class ApiController extends Controller {
|
|||
}
|
||||
|
||||
public function actionTest() {
|
||||
// $updating = \app\models\SyncUrl::findOne(['key_config' => 'token']);
|
||||
$updating = \app\models\SyncUrl::find()->all();
|
||||
foreach ($updating as $key => $value) {
|
||||
echo $value->key_config . " " . $value->data . "<br>";
|
||||
}
|
||||
exit();
|
||||
$server_ip = \app\models\SyncUrl::findOne(['key_config' => 'server_api']);
|
||||
$ip = "https://dev-dc.beetai.com";
|
||||
if ($server_ip)
|
||||
$ip = $server_ip->data;
|
||||
$parseUrl = parse_url($ip);
|
||||
$host = $parseUrl['host'];
|
||||
$port = isset($parseUrl['port']) ? $parseUrl['port'] : 80;
|
||||
$this->is_connected($host, $port);
|
||||
}
|
||||
|
||||
public function actionReGenFeature() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user