Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F109893936
PhabricatorDaemonLogEventGarbageCollector.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
Wed, Apr 23, 21:16
Size
538 B
Mime Type
text/x-php
Expires
Fri, Apr 25, 21:16 (2 d)
Engine
blob
Format
Raw Data
Handle
25733634
Attached To
rPH Phabricator
PhabricatorDaemonLogEventGarbageCollector.php
View Options
<?php
final
class
PhabricatorDaemonLogEventGarbageCollector
extends
PhabricatorGarbageCollector
{
public
function
collectGarbage
()
{
$ttl
=
PhabricatorEnv
::
getEnvConfig
(
'gcdaemon.ttl.daemon-logs'
);
if
(
$ttl
<=
0
)
{
return
false
;
}
$table
=
new
PhabricatorDaemonLogEvent
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
queryfx
(
$conn_w
,
'DELETE FROM %T WHERE epoch < %d LIMIT 100'
,
$table
->
getTableName
(),
time
()
-
$ttl
);
return
(
$conn_w
->
getAffectedRows
()
==
100
);
}
}
Event Timeline
Log In to Comment