Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90750263
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
Mon, Nov 4, 10:26
Size
603 B
Mime Type
text/x-php
Expires
Wed, Nov 6, 10:26 (2 d)
Engine
blob
Format
Raw Data
Handle
22129151
Attached To
rPH Phabricator
PhabricatorCacheGeneralGarbageCollector.php
View Options
<?php
final
class
PhabricatorCacheGeneralGarbageCollector
extends
PhabricatorGarbageCollector
{
public
function
collectGarbage
()
{
$key
=
'gcdaemon.ttl.general-cache'
;
$ttl
=
PhabricatorEnv
::
getEnvConfig
(
$key
);
if
(
$ttl
<=
0
)
{
return
false
;
}
$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
(),
time
()
-
$ttl
);
return
(
$conn_w
->
getAffectedRows
()
==
100
);
}
}
Event Timeline
Log In to Comment