Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93938245
PhabricatorDaemonLogGarbageCollector.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
Mon, Dec 2, 16:20
Size
595 B
Mime Type
text/x-php
Expires
Wed, Dec 4, 16:20 (2 d)
Engine
blob
Format
Raw Data
Handle
22727830
Attached To
rPH Phabricator
PhabricatorDaemonLogGarbageCollector.php
View Options
<?php
final
class
PhabricatorDaemonLogGarbageCollector
extends
PhabricatorGarbageCollector
{
public
function
collectGarbage
()
{
$ttl
=
PhabricatorEnv
::
getEnvConfig
(
'gcdaemon.ttl.daemon-logs'
);
if
(
$ttl
<=
0
)
{
return
false
;
}
$table
=
new
PhabricatorDaemonLog
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
queryfx
(
$conn_w
,
'DELETE FROM %T WHERE dateCreated < %d AND status != %s LIMIT 100'
,
$table
->
getTableName
(),
time
()
-
$ttl
,
PhabricatorDaemonLog
::
STATUS_RUNNING
);
return
(
$conn_w
->
getAffectedRows
()
==
100
);
}
}
Event Timeline
Log In to Comment