update unlink
This commit is contained in:
parent
2b3e30ad0e
commit
74d8ab31bf
|
@ -69,7 +69,7 @@ class ApiController extends Controller {
|
||||||
$totalsLogs = CaptureLogs::find()->count();
|
$totalsLogs = CaptureLogs::find()->count();
|
||||||
if ($totalsLogs >= \Yii::$app->params['maxLogs']) {
|
if ($totalsLogs >= \Yii::$app->params['maxLogs']) {
|
||||||
$lastLogs = CaptureLogs::find()->orderBy(["id" => SORT_ASC])->limit(1)->one();
|
$lastLogs = CaptureLogs::find()->orderBy(["id" => SORT_ASC])->limit(1)->one();
|
||||||
unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $lastLogs->image);
|
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $lastLogs->image);
|
||||||
$lastLogs->delete();
|
$lastLogs->delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,18 +269,18 @@ class ApiController extends Controller {
|
||||||
$updating->data = "false";
|
$updating->data = "false";
|
||||||
$updating->save();
|
$updating->save();
|
||||||
$txt = "\n" . date("H:i:s d/m/Y") . " " . "success";
|
$txt = "\n" . date("H:i:s d/m/Y") . " " . "success";
|
||||||
file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
// file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
||||||
return ["status" => false];
|
return ["status" => false];
|
||||||
} else {
|
} else {
|
||||||
$txt = "\n" . date("H:i:s d/m/Y") . " " . "updating";
|
$txt = "\n" . date("H:i:s d/m/Y") . " " . "updating";
|
||||||
file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
// file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
||||||
return ["status" => false];
|
return ["status" => false];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($currentCache['n_128'] == $currentCache['n_512']) {
|
if ($currentCache['n_128'] == $currentCache['n_512']) {
|
||||||
$txt = "\n" . date("H:i:s d/m/Y") . " " . "success";
|
$txt = "\n" . date("H:i:s d/m/Y") . " " . "success";
|
||||||
file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
// file_put_contents(date('Ymd') . "_logs.txt", $txt, FILE_APPEND);
|
||||||
return ["status" => false];
|
return ["status" => false];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ class ApiController extends Controller {
|
||||||
$finish = $this->getCurrentTime();
|
$finish = $this->getCurrentTime();
|
||||||
$processTime["updateDB"] = round(($finish - $start), 4);
|
$processTime["updateDB"] = round(($finish - $start), 4);
|
||||||
$txt = "\n" . json_encode($processTime);
|
$txt = "\n" . json_encode($processTime);
|
||||||
file_put_contents(date('Ymd') . ".txt", $txt, FILE_APPEND);
|
// file_put_contents(date('Ymd') . ".txt", $txt, FILE_APPEND);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -481,6 +481,12 @@ class ApiController extends Controller {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function actionTest() {
|
public function actionTest() {
|
||||||
|
$logs = CaptureLogs::find()->andWhere(["<=", "time", 1646092799])->count();
|
||||||
|
foreach ($logs as $key => $value) {
|
||||||
|
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value->image);
|
||||||
|
$value->delete();
|
||||||
|
}
|
||||||
|
exit();
|
||||||
// $updating = \app\models\SyncUrl::findOne(['key_config' => 'token']);
|
// $updating = \app\models\SyncUrl::findOne(['key_config' => 'token']);
|
||||||
$updating = \app\models\SyncUrl::find()->all();
|
$updating = \app\models\SyncUrl::find()->all();
|
||||||
foreach ($updating as $key => $value) {
|
foreach ($updating as $key => $value) {
|
||||||
|
@ -639,7 +645,7 @@ class ApiController extends Controller {
|
||||||
if ($value['serverKey'] !== $files_name)
|
if ($value['serverKey'] !== $files_name)
|
||||||
$ft[] = $value;
|
$ft[] = $value;
|
||||||
else
|
else
|
||||||
unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value['url']);
|
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $value['url']);
|
||||||
}
|
}
|
||||||
$model->image = json_encode($ft);
|
$model->image = json_encode($ft);
|
||||||
$model->last_modified = time();
|
$model->last_modified = time();
|
||||||
|
@ -677,7 +683,7 @@ class ApiController extends Controller {
|
||||||
if ($model) {
|
if ($model) {
|
||||||
$images = json_decode($model->image, true);
|
$images = json_decode($model->image, true);
|
||||||
foreach ($images as $k => $v) {
|
foreach ($images as $k => $v) {
|
||||||
unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $v['url']);
|
@unlink("/var/www/html/BiFace_Server_Lite/web/data/uploads/face/" . $v['url']);
|
||||||
}
|
}
|
||||||
$model->delete();
|
$model->delete();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user