Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96526216
PhabricatorCacheGeneralGarbageCollector.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
Fri, Dec 27, 15:05
Size
701 B
Mime Type
text/x-php
Expires
Sun, Dec 29, 15:05 (1 d, 7 h)
Engine
blob
Format
Raw Data
Handle
23198150
Attached To
rPH Phabricator
PhabricatorCacheGeneralGarbageCollector.php
View Options
<?php
final
class
PhabricatorCacheGeneralGarbageCollector
extends
PhabricatorGarbageCollector
{
const
COLLECTORCONST
=
'cache.general'
;
public
function
getCollectorName
()
{
return
pht
(
'General Cache'
);
}
public
function
getDefaultRetentionPolicy
()
{
return
phutil_units
(
'30 days in seconds'
);
}
protected
function
collectGarbage
()
{
$cache
=
new
PhabricatorKeyValueDatabaseCache
();
$conn_w
=
$cache
->
establishConnection
(
'w'
);
queryfx
(
$conn_w
,
'DELETE FROM %T WHERE cacheCreated < %d
ORDER BY cacheCreated ASC LIMIT 100'
,
$cache
->
getTableName
(),
$this
->
getGarbageEpoch
());
return
(
$conn_w
->
getAffectedRows
()
==
100
);
}
}
Event Timeline
Log In to Comment