3 final class HeraldWebhookRequestGarbageCollector
4 extends PhabricatorGarbageCollector
{
6 const COLLECTORCONST
= 'herald.webhooks';
8 public function getCollectorName() {
9 return pht('Herald Webhooks');
12 public function getDefaultRetentionPolicy() {
13 return phutil_units('7 days in seconds');
16 protected function collectGarbage() {
17 $table = new HeraldWebhookRequest();
18 $conn_w = $table->establishConnection('w');
22 'DELETE FROM %T WHERE dateCreated < %d LIMIT 100',
23 $table->getTableName(),
24 $this->getGarbageEpoch());
26 return ($conn_w->getAffectedRows() == 100);