Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98654270
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, Jan 15, 07:53
Size
671 B
Mime Type
text/x-php
Expires
Fri, Jan 17, 07:53 (2 d)
Engine
blob
Format
Raw Data
Handle
23600336
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