summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/gallery_event.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2013-02-17 15:46:52 -0800
committerBharat Mediratta <bharat@menalto.com>2013-02-17 15:46:52 -0800
commit9f02011dacdd2c4bf6d2d1c29be522f04a3d13c7 (patch)
tree6436553d04c789c36cc9eeafe87a35d47bce9098 /modules/gallery/helpers/gallery_event.php
parent87d20c63af02ae573853da2cb82d7323a56677b5 (diff)
parentfd0051dab7258c817ff01877bd4324530ce79398 (diff)
Merge pull request #148 from shadlaws/fix_2006
#2006 - Add system::mark_file_for_delete API to delete files at shutdown.
Diffstat (limited to 'modules/gallery/helpers/gallery_event.php')
-rw-r--r--modules/gallery/helpers/gallery_event.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php
index 26432ef5..a319b9c6 100644
--- a/modules/gallery/helpers/gallery_event.php
+++ b/modules/gallery/helpers/gallery_event.php
@@ -44,7 +44,7 @@ class gallery_event_Core {
// var/tmp might be stickier because theoretically we could wind up spamming that
// dir with a lot of files. But let's start with this and refine as we go.
if (!(rand() % 500)) {
- // Note that this code is roughly duplicated in gallery_event::gallery_shutdown
+ // Note that this code is roughly duplicated in gallery_task::file_cleanup
$threshold = time() - 1209600; // older than 2 weeks
foreach(array("logs", "tmp") as $dir) {
$dir = VARPATH . $dir;
@@ -67,6 +67,8 @@ class gallery_event_Core {
}
}
}
+ // Delete all files marked using system::delete_later.
+ system::delete_marked_files();
}
static function user_deleted($user) {