Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F82524065
HeraldTranscriptGarbageCollector.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, Sep 11, 22:03
Size
751 B
Mime Type
text/x-php
Expires
Fri, Sep 13, 22:03 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20711064
Attached To
rPH Phabricator
HeraldTranscriptGarbageCollector.php
View Options
<?php
final
class
HeraldTranscriptGarbageCollector
extends
PhabricatorGarbageCollector
{
public
function
collectGarbage
()
{
$ttl
=
PhabricatorEnv
::
getEnvConfig
(
'gcdaemon.ttl.herald-transcripts'
);
if
(
$ttl
<=
0
)
{
return
false
;
}
$table
=
new
HeraldTranscript
();
$conn_w
=
$table
->
establishConnection
(
'w'
);
queryfx
(
$conn_w
,
'UPDATE %T SET
objectTranscript = "",
ruleTranscripts = "",
conditionTranscripts = "",
applyTranscripts = "",
garbageCollected = 1
WHERE garbageCollected = 0 AND `time` < %d
LIMIT 100'
,
$table
->
getTableName
(),
time
()
-
$ttl
);
return
(
$conn_w
->
getAffectedRows
()
==
100
);
}
}
Event Timeline
Log In to Comment