Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90419093
PhabricatorFileExternalRequestGarbageCollector.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, Nov 1, 12:32
Size
673 B
Mime Type
text/x-php
Expires
Sun, Nov 3, 12:32 (2 d)
Engine
blob
Format
Raw Data
Handle
22073029
Attached To
rPH Phabricator
PhabricatorFileExternalRequestGarbageCollector.php
View Options
<?php
final
class
PhabricatorFileExternalRequestGarbageCollector
extends
PhabricatorGarbageCollector
{
const
COLLECTORCONST
=
'files.externalttl'
;
public
function
getCollectorName
()
{
return
pht
(
'External Requests (TTL)'
);
}
public
function
hasAutomaticPolicy
()
{
return
true
;
}
protected
function
collectGarbage
()
{
$file_requests
=
id
(
new
PhabricatorFileExternalRequest
())->
loadAllWhere
(
'ttl < %d LIMIT 100'
,
PhabricatorTime
::
getNow
());
$engine
=
new
PhabricatorDestructionEngine
();
foreach
(
$file_requests
as
$request
)
{
$engine
->
destroyObject
(
$request
);
}
return
(
count
(
$file_requests
)
==
100
);
}
}
Event Timeline
Log In to Comment