Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / diffusion / garbagecollector / DiffusionPullEventGarbageCollector.php
blob9407b95070489076f4244dc4ab6a33ed5e2f6b08
1 <?php
3 final class DiffusionPullEventGarbageCollector
4 extends PhabricatorGarbageCollector {
6 const COLLECTORCONST = 'diffusion.pull';
8 public function getCollectorName() {
9 return pht('Repository Pull Events');
12 public function getDefaultRetentionPolicy() {
13 return phutil_units('30 days in seconds');
16 protected function collectGarbage() {
17 $table = new PhabricatorRepositoryPullEvent();
18 $conn_w = $table->establishConnection('w');
20 queryfx(
21 $conn_w,
22 'DELETE FROM %T WHERE epoch < %d LIMIT 100',
23 $table->getTableName(),
24 $this->getGarbageEpoch());
26 return ($conn_w->getAffectedRows() == 100);