Page MenuHomePhorge

MetaMTAMailSentGarbageCollector.php
No OneTemporary

Size
637 B
Referenced Files
None
Subscribers
None

MetaMTAMailSentGarbageCollector.php

<?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');
}
public function collectGarbage() {
$ttl = phutil_units('90 days in seconds');
$mails = id(new PhabricatorMetaMTAMail())->loadAllWhere(
'dateCreated < %d LIMIT 100',
PhabricatorTime::getNow() - $ttl);
foreach ($mails as $mail) {
$mail->delete();
}
return (count($mails) == 100);
}
}

File Metadata

Mime Type
text/x-php
Expires
Mon, Jun 30, 3:13 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
269454
Default Alt Text
MetaMTAMailSentGarbageCollector.php (637 B)

Event Timeline