Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/differential/garbagecollector/DifferentialViewStateGarbageCollector.php
12256 views
1
<?php
2
3
final class DifferentialViewStateGarbageCollector
4
extends PhabricatorGarbageCollector {
5
6
const COLLECTORCONST = 'differential.viewstate';
7
8
public function getCollectorName() {
9
return pht('Differential View States');
10
}
11
12
public function getDefaultRetentionPolicy() {
13
return phutil_units('180 days in seconds');
14
}
15
16
protected function collectGarbage() {
17
$table = new DifferentialViewState();
18
$conn = $table->establishConnection('w');
19
20
queryfx(
21
$conn,
22
'DELETE FROM %R WHERE dateModified < %d LIMIT 100',
23
$table,
24
$this->getGarbageEpoch());
25
26
return ($conn->getAffectedRows() == 100);
27
}
28
29
}
30
31