diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-05-03 21:18:41 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-05-03 21:19:25 +0200 |
commit | 55c421addac2f814e1a41cc729288276d306f03f (patch) | |
tree | 9cb8946c917cd7488d395cbf3141cf3696b1286a | |
parent | 6d80b653f0348f683804a36db196b61b500a900a (diff) |
file/clean_stale_files: Refactor into multiple methods
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rw-r--r-- | application/controllers/Main.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/application/controllers/Main.php b/application/controllers/Main.php index 63e9843dd..94d025678 100644 --- a/application/controllers/Main.php +++ b/application/controllers/Main.php @@ -895,6 +895,13 @@ class Main extends MY_Controller { { $this->_require_cli_request(); + $this->remove_files_missing_in_db(); + $this->remove_files_missing_on_disk(); + $this->clean_multipaste_tarballs(); + } + + private function remove_files_missing_in_db() + { $upload_path = $this->config->item("upload_path"); $outer_dh = opendir($upload_path); @@ -940,7 +947,10 @@ class Main extends MY_Controller { } } closedir($outer_dh); + } + private function remove_files_missing_on_disk() + { $chunk = 500; $total = $this->db->count_all("file_storage"); @@ -959,8 +969,6 @@ class Main extends MY_Controller { } } } - - $this->clean_multipaste_tarballs(); } function nuke_id() |