Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F37955025
PhabricatorGarbageCollectorDaemon.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
1 KB
Subscribers
None
PhabricatorGarbageCollectorDaemon.php
View Options
<?php
/**
* Collects old logs and caches to reduce the amount of data stored in the
* database.
*/
final
class
PhabricatorGarbageCollectorDaemon
extends
PhabricatorDaemon
{
public
function
run
()
{
$collectors
=
id
(
new
PhutilSymbolLoader
())
->
setAncestorClass
(
'PhabricatorGarbageCollector'
)
->
loadObjects
();
do
{
foreach
(
$collectors
as
$name
=>
$collector
)
{
$more_garbage
=
false
;
do
{
if
(
$more_garbage
)
{
$this
->
log
(
pht
(
'Collecting more garbage with "%s".'
,
$name
));
}
else
{
$this
->
log
(
pht
(
'Collecting garbage with "%s".'
,
$name
));
}
$more_garbage
=
$collector
->
collectGarbage
();
$this
->
stillWorking
();
}
while
(
$more_garbage
);
}
// We made it to the end of the run cycle of every GC, so we're more or
// less caught up. Ease off the GC loop so we don't keep doing table
// scans just to delete a handful of rows; wake up in a few hours.
$this
->
log
(
pht
(
'All caught up, waiting for more garbage.'
));
$this
->
sleep
(
4
*
(
60
*
60
));
}
while
(
true
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Mar 19, 6:07 PM (1 d, 5 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
2c/d1/1c6a5fadaa2d8d162714847f1bdd
Attached To
rPHAB Phabricator
Event Timeline
Log In to Comment