Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F727150
D364.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Jan 6, 7:51 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Tue, Jan 7, 7:51 AM (2 d, 23 h ago)
Engine
blob
Format
Raw Data
Handle
537204
Attached To
D364: INP-1767 - Purge expired database cache entries
D364.diff
View Options
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
Log In to Comment