Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / conduit / garbagecollector / ConduitLogGarbageCollector.php
blob318cb43ad139e88ef28894fb29f4989b6cc52b36
1 <?php
3 final class ConduitLogGarbageCollector
4 extends PhabricatorGarbageCollector {
6 const COLLECTORCONST = 'conduit.logs';
8 public function getCollectorName() {
9 return pht('Conduit Logs');
12 public function getDefaultRetentionPolicy() {
13 return phutil_units('180 days in seconds');
16 protected function collectGarbage() {
17 $table = new PhabricatorConduitMethodCallLog();
18 $conn_w = $table->establishConnection('w');
20 queryfx(
21 $conn_w,
22 'DELETE FROM %T WHERE dateCreated < %d
23 ORDER BY dateCreated ASC LIMIT 100',
24 $table->getTableName(),
25 $this->getGarbageEpoch());
27 return ($conn_w->getAffectedRows() == 100);