Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F87679291
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
Mon, Oct 14, 04:36
Size
751 B
Mime Type
text/x-php
Expires
Wed, Oct 16, 04:36 (2 d)
Engine
blob
Format
Raw Data
Handle
21638044
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