Something went wrong. Try again.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
Something went wrong. Try again.
643 B · 29 lines
PHP
123456789101112131415161718192021222324252627282930<?php
final class MultimeterEventGarbageCollector extends PhabricatorGarbageCollector {
const COLLECTORCONST = 'multimeter.events';
public function getCollectorName() { return pht('Multimeter Events'); }
public function getDefaultRetentionPolicy() { return phutil_units('90 days in seconds'); }
protected function collectGarbage() { $table = new MultimeterEvent(); $conn_w = $table->establishConnection('w');
queryfx( $conn_w, 'DELETE FROM %T WHERE epoch < %d LIMIT 100', $table->getTableName(), $this->getGarbageEpoch());
return ($conn_w->getAffectedRows() == 100); }
}