Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / metamta / garbagecollector / MetaMTAMailReceivedGarbageCollector.php
blobb23a006c65689563c221adabb5c06115482f1cef
1 <?php
3 final class MetaMTAMailReceivedGarbageCollector
4 extends PhabricatorGarbageCollector {
6 const COLLECTORCONST = 'metamta.received';
8 public function getCollectorName() {
9 return pht('Mail (Received)');
12 public function getDefaultRetentionPolicy() {
13 return phutil_units('90 days in seconds');
16 protected function collectGarbage() {
17 $table = new PhabricatorMetaMTAReceivedMail();
18 $conn_w = $table->establishConnection('w');
20 queryfx(
21 $conn_w,
22 'DELETE FROM %T WHERE dateCreated < %d LIMIT 100',
23 $table->getTableName(),
24 $this->getGarbageEpoch());
26 return ($conn_w->getAffectedRows() == 100);