[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/daemon/garbagecollector/ -> PhabricatorDaemonLogEventGarbageCollector.php (source)

   1  <?php
   2  
   3  final class PhabricatorDaemonLogEventGarbageCollector
   4    extends PhabricatorGarbageCollector {
   5  
   6    public function collectGarbage() {
   7      $ttl = PhabricatorEnv::getEnvConfig('gcdaemon.ttl.daemon-logs');
   8      if ($ttl <= 0) {
   9        return false;
  10      }
  11  
  12      $table = new PhabricatorDaemonLogEvent();
  13      $conn_w = $table->establishConnection('w');
  14  
  15      queryfx(
  16        $conn_w,
  17        'DELETE FROM %T WHERE epoch < %d LIMIT 100',
  18        $table->getTableName(),
  19        time() - $ttl);
  20  
  21      return ($conn_w->getAffectedRows() == 100);
  22    }
  23  
  24  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1