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.
653 B · 29 lines
PHP
123456789101112131415161718192021222324252627282930<?php
final class DifferentialViewStateGarbageCollector extends PhabricatorGarbageCollector {
const COLLECTORCONST = 'differential.viewstate';
public function getCollectorName() { return pht('Differential View States'); }
public function getDefaultRetentionPolicy() { return phutil_units('180 days in seconds'); }
protected function collectGarbage() { $table = new DifferentialViewState(); $conn = $table->establishConnection('w');
queryfx( $conn, 'DELETE FROM %R WHERE dateModified < %d LIMIT 100', $table, $this->getGarbageEpoch());
return ($conn->getAffectedRows() == 100); }
}