Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F96524859
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
Fri, Dec 27, 14:37
Size
707 B
Mime Type
text/x-php
Expires
Sun, Dec 29, 14:37 (2 d)
Engine
blob
Format
Raw Data
Handle
23198015
Attached To
rPH Phabricator
PhabricatorDaemonLogGarbageCollector.php
View Options
<?php
final
class
PhabricatorDaemonLogGarbageCollector
extends
PhabricatorGarbageCollector
{
const
COLLECTORCONST
=
'daemon.logs'
;
public
function
getCollectorName
()
{
return
pht
(
'Daemon Logs'
);
}
public
function
getDefaultRetentionPolicy
()
{
return
phutil_units
(
'7 days in seconds'
);
}
protected
function
collectGarbage
()
{
$table
=
new
PhabricatorDaemonLog
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
queryfx
(
$conn_w
,
'DELETE FROM %T WHERE dateCreated < %d AND status != %s LIMIT 100'
,
$table
->
getTableName
(),
$this
->
getGarbageEpoch
(),
PhabricatorDaemonLog
::
STATUS_RUNNING
);
return
(
$conn_w
->
getAffectedRows
()
==
100
);
}
}
Event Timeline
Log In to Comment