From fad1f05203f9c45b759fd0f4731e9025bca86114 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sat, 18 Sep 2010 17:46:28 -0700 Subject: The Kohana folks removed the cache cleanup code back in http://dev.kohanaframework.org/projects/kohana2/repository/revisions/4605 So now our cache entries don't expire. For now, do cache expiration whenever we render Admin > Maintenance, since that's the type of place that users will go when they want their cache to expire anyway. --- modules/gallery/controllers/admin_maintenance.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'modules/gallery/controllers') diff --git a/modules/gallery/controllers/admin_maintenance.php b/modules/gallery/controllers/admin_maintenance.php index a9cc933c..7729d797 100644 --- a/modules/gallery/controllers/admin_maintenance.php +++ b/modules/gallery/controllers/admin_maintenance.php @@ -48,6 +48,13 @@ class Admin_Maintenance_Controller extends Admin_Controller { $view->content->finished_tasks = ORM::factory("task") ->where("done", "=", 1)->order_by("updated", "DESC")->find_all(); print $view; + + // Do some maintenance while we're in here + db::build() + ->delete("caches") + ->where("expiration", "<>", 0) + ->where("expiration", "<=", time()) + ->execute(); } /** -- cgit v1.2.3