Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96530543
MetaMTAMailSentGarbageCollector.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, 16:36
Size
584 B
Mime Type
text/x-php
Expires
Sun, Dec 29, 16:36 (2 d)
Engine
blob
Format
Raw Data
Handle
23198736
Attached To
rPH Phabricator
MetaMTAMailSentGarbageCollector.php
View Options
<?php
final
class
MetaMTAMailSentGarbageCollector
extends
PhabricatorGarbageCollector
{
const
COLLECTORCONST
=
'metamta.sent'
;
public
function
getCollectorName
()
{
return
pht
(
'Mail (Sent)'
);
}
public
function
getDefaultRetentionPolicy
()
{
return
phutil_units
(
'90 days in seconds'
);
}
protected
function
collectGarbage
()
{
$mails
=
id
(
new
PhabricatorMetaMTAMail
())->
loadAllWhere
(
'dateCreated < %d LIMIT 100'
,
$this
->
getGarbageEpoch
());
foreach
(
$mails
as
$mail
)
{
$mail
->
delete
();
}
return
(
count
(
$mails
)
==
100
);
}
}
Event Timeline
Log In to Comment