Path: blob/master/src/applications/herald/garbagecollector/HeraldTranscriptGarbageCollector.php
12256 views
<?php12final class HeraldTranscriptGarbageCollector3extends PhabricatorGarbageCollector {45const COLLECTORCONST = 'herald.transcripts';67public function getCollectorName() {8return pht('Herald Transcripts');9}1011public function getDefaultRetentionPolicy() {12return phutil_units('30 days in seconds');13}1415protected function collectGarbage() {16$table = new HeraldTranscript();17$conn_w = $table->establishConnection('w');1819queryfx(20$conn_w,21'UPDATE %T SET22objectTranscript = "",23ruleTranscripts = "",24conditionTranscripts = "",25applyTranscripts = "",26garbageCollected = 127WHERE garbageCollected = 0 AND time < %d28LIMIT 100',29$table->getTableName(),30$this->getGarbageEpoch());3132return ($conn_w->getAffectedRows() == 100);33}3435}363738