mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-01 11:12:42 +01:00
22 lines
468 B
PHP
22 lines
468 B
PHP
|
<?php
|
||
|
|
||
|
final class MultimeterEventGarbageCollector
|
||
|
extends PhabricatorGarbageCollector {
|
||
|
|
||
|
public function collectGarbage() {
|
||
|
$ttl = phutil_units('90 days in seconds');
|
||
|
|
||
|
$table = new MultimeterEvent();
|
||
|
$conn_w = $table->establishConnection('w');
|
||
|
|
||
|
queryfx(
|
||
|
$conn_w,
|
||
|
'DELETE FROM %T WHERE epoch < %d LIMIT 100',
|
||
|
$table->getTableName(),
|
||
|
PhabricatorTime::getNow() - $ttl);
|
||
|
|
||
|
return ($conn_w->getAffectedRows() == 100);
|
||
|
}
|
||
|
|
||
|
}
|