Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1169966
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
Sat, Sep 27, 12:01 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Sun, Sep 28, 12:01 AM (17 h, 16 m)
Engine
blob
Format
Raw Data
Handle
758082
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