From f3f9c88065cbab8f49559074a8a51e977102fb6e Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Tue, 15 Jun 2021 02:18:00 +0800 Subject: [PATCH] cleanup_cli force mode --- include/cleanup_cli.php | 7 ++++++- include/functions.php | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/cleanup_cli.php b/include/cleanup_cli.php index 9bc5d3fe..e2673f5e 100644 --- a/include/cleanup_cli.php +++ b/include/cleanup_cli.php @@ -21,7 +21,12 @@ if (isset($_SERVER['argv'][1])) { } try { - $result = autoclean($force, true); + if ($force) { + require_once($rootpath . 'include/cleanup.php'); + return docleanup(1, true); + } else { + $result = autoclean(); + } do_log("[CLEANUP_CLI DONE!] $result"); } catch (\Exception $exception) { do_log("ERROR: " . $exception->getMessage()); diff --git a/include/functions.php b/include/functions.php index 13d9c97f..c946751e 100644 --- a/include/functions.php +++ b/include/functions.php @@ -1898,7 +1898,7 @@ function userlogin() { return $loginResult = true; } -function autoclean($forceAll = 0, $printProgress = false) { +function autoclean() { global $autoclean_interval_one, $rootpath; $now = TIMENOW; $res = sql_query("SELECT value_u FROM avps WHERE arg = 'lastcleantime'"); @@ -1919,7 +1919,7 @@ function autoclean($forceAll = 0, $printProgress = false) { return false; } require_once($rootpath . 'include/cleanup.php'); - return docleanup($forceAll, $printProgress); + return docleanup(); } function unesc($x) {