Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2896869
PhabricatorCacheTTLGarbageCollector.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
671 B
Referenced Files
None
Subscribers
None
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
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Jan 19 2025, 23:40 (6 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1130003
Default Alt Text
PhabricatorCacheTTLGarbageCollector.php (671 B)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment