Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F90661780
MultimeterEventGarbageCollector.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Nov 3, 16:19
Size
468 B
Mime Type
text/x-php
Expires
Tue, Nov 5, 16:19 (2 d)
Engine
blob
Format
Raw Data
Handle
22116077
Attached To
rPH Phabricator
MultimeterEventGarbageCollector.php
View Options
<?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
);
}
}
Event Timeline
Log In to Comment