add cli force

This commit is contained in:
xiaomlove
2021-06-15 02:02:09 +08:00
parent 61f9260fb1
commit c367fef2a4
2 changed files with 8 additions and 3 deletions
+6 -1
View File
@@ -15,8 +15,13 @@ register_shutdown_function(function () use ($fd) {
fclose($fd);
});
$force = 0;
if (isset($_SERVER['argv'][1])) {
$force = $_SERVER['argv'][1] ? 1 : 0;
}
try {
$result = autoclean();
$result = autoclean($force, true);
do_log("[CLEANUP_CLI DONE!] $result");
} catch (\Exception $exception) {
do_log("ERROR: " . $exception->getMessage());