@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 PhabricatorDaemonLockLogGarbageCollector
4 extends PhabricatorGarbageCollector {
5
6 const COLLECTORCONST = 'daemon.lock-log';
7
8 public function getCollectorName() {
9 return pht('Lock Logs');
10 }
11
12 public function getDefaultRetentionPolicy() {
13 return 0;
14 }
15
16 protected function collectGarbage() {
17 $table = new PhabricatorDaemonLockLog();
18 $conn = $table->establishConnection('w');
19
20 queryfx(
21 $conn,
22 'DELETE FROM %T WHERE dateCreated < %d LIMIT 100',
23 $table->getTableName(),
24 $this->getGarbageEpoch());
25
26 return ($conn->getAffectedRows() == 100);
27 }
28
29}