Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F773072
D364.id967.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
Sun, Feb 2, 12:55 AM
Size
1 KB
Mime Type
text/x-diff
Expires
Mon, Feb 3, 12:55 AM (14 h, 48 m)
Engine
blob
Format
Raw Data
Handle
556335
Attached To
D364: INP-1767 - Purge expired database cache entries
D364.id967.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