Page MenuHomeIn-Portal Phabricator

D364.diff
No OneTemporary

File Metadata

Created
Mon, Jan 6, 7:51 AM

D364.diff

Index: branches/5.2.x/core/units/admin/admin_config.php
===================================================================
--- branches/5.2.x/core/units/admin/admin_config.php
+++ branches/5.2.x/core/units/admin/admin_config.php
@@ -30,6 +30,7 @@
'ScheduledTasks' => Array (
'optimize_performance' => Array ('EventName' => 'OnOptimizePerformance', 'RunSchedule' => '0 0 * * *'),
+ 'purge_expired_database_cache' => Array ('EventName' => 'OnPurgeExpiredDatabaseCacheScheduledTask', 'RunSchedule' => '0 0,12 * * *'),
),
'TitlePresets' => Array (
Index: branches/5.2.x/core/units/admin/admin_events_handler.php
===================================================================
--- branches/5.2.x/core/units/admin/admin_events_handler.php
+++ branches/5.2.x/core/units/admin/admin_events_handler.php
@@ -1219,6 +1219,21 @@
}
}
}
+
+ /**
+ * Purges expired database cache entries.
+ *
+ * @param kEvent $event Event.
+ *
+ * @return void
+ */
+ protected function OnPurgeExpiredDatabaseCacheScheduledTask(kEvent $event)
+ {
+ $sql = 'DELETE FROM ' . TABLE_PREFIX . 'SystemCache
+ WHERE LifeTime > 0 AND Cached + LifeTime < ' . time();
+ $this->Conn->Query($sql);
+ }
+
}

Event Timeline