@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
1<?php
2
3final class DiffusionPullEventGarbageCollector
4 extends PhabricatorGarbageCollector {
5
6 const COLLECTORCONST = 'diffusion.pull';
7
8 public function getCollectorName() {
9 return pht('Repository Pull Events');
10 }
11
12 public function getDefaultRetentionPolicy() {
13 return phutil_units('30 days in seconds');
14 }
15
16 protected function collectGarbage() {
17 $table = new PhabricatorRepositoryPullEvent();
18 $conn_w = $table->establishConnection('w');
19
20 queryfx(
21 $conn_w,
22 'DELETE FROM %T WHERE epoch < %d LIMIT 100',
23 $table->getTableName(),
24 $this->getGarbageEpoch());
25
26 return ($conn_w->getAffectedRows() == 100);
27 }
28
29}