Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93850419
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
Mon, Dec 2, 00:23
Size
671 B
Mime Type
text/x-php
Expires
Wed, Dec 4, 00:23 (2 d)
Engine
blob
Format
Raw Data
Handle
22714249
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