Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / metamta / garbagecollector / MetaMTAMailSentGarbageCollector.php
blobdacd46d18719866085599c4838df747c66daf6a9
1 <?php
3 final class MetaMTAMailSentGarbageCollector
4 extends PhabricatorGarbageCollector {
6 const COLLECTORCONST = 'metamta.sent';
8 public function getCollectorName() {
9 return pht('Mail (Sent)');
12 public function getDefaultRetentionPolicy() {
13 return phutil_units('90 days in seconds');
16 protected function collectGarbage() {
17 $mails = id(new PhabricatorMetaMTAMail())->loadAllWhere(
18 'dateCreated < %d LIMIT 100',
19 $this->getGarbageEpoch());
21 $engine = new PhabricatorDestructionEngine();
22 foreach ($mails as $mail) {
23 $engine->destroyObject($mail);
26 return (count($mails) == 100);