Page MenuHomestyx hydra

PhabricatorCacheTTLGarbageCollector.php
No OneTemporary

PhabricatorCacheTTLGarbageCollector.php

<?php
final class PhabricatorCacheTTLGarbageCollector
extends PhabricatorGarbageCollector {
const COLLECTORCONST = 'cache.general.ttl';
public function getCollectorName() {
return pht('General Cache (TTL)');
}
public function hasAutomaticPolicy() {
return true;
}
public function collectGarbage() {
$cache = new PhabricatorKeyValueDatabaseCache();
$conn_w = $cache->establishConnection('w');
queryfx(
$conn_w,
'DELETE FROM %T WHERE cacheExpires < %d
ORDER BY cacheExpires ASC LIMIT 100',
$cache->getTableName(),
time());
return ($conn_w->getAffectedRows() == 100);
}
}

File Metadata

Mime Type
text/x-php
Expires
Tue, Feb 24, 10:12 PM (18 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
851474
Default Alt Text
PhabricatorCacheTTLGarbageCollector.php (649 B)

Event Timeline