Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F121784773
PhabricatorCacheTTLGarbageCollector.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jul 13, 21:24
Size
671 B
Mime Type
text/x-php
Expires
Tue, Jul 15, 21:24 (2 d)
Engine
blob
Format
Raw Data
Handle
27390741
Attached To
rPH Phabricator
PhabricatorCacheTTLGarbageCollector.php
View Options
<?php
final
class
PhabricatorCacheTTLGarbageCollector
extends
PhabricatorGarbageCollector
{
const
COLLECTORCONST
=
'cache.general.ttl'
;
public
function
getCollectorName
()
{
return
pht
(
'General Cache (TTL)'
);
}
public
function
hasAutomaticPolicy
()
{
return
true
;
}
protected
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
(),
PhabricatorTime
::
getNow
());
return
(
$conn_w
->
getAffectedRows
()
==
100
);
}
}
Event Timeline
Log In to Comment