Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F109810996
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
Wed, Apr 23, 12:02
Size
671 B
Mime Type
text/x-php
Expires
Fri, Apr 25, 12:02 (2 d)
Engine
blob
Format
Raw Data
Handle
25759811
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