Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13982348
D9610.id23034.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D9610.id23034.diff
View Options
diff --git a/resources/sql/autopatches/20140617.daemonlog.sql b/resources/sql/autopatches/20140617.daemonlog.sql
new file mode 100644
--- /dev/null
+++ b/resources/sql/autopatches/20140617.daemonlog.sql
@@ -0,0 +1,2 @@
+ALTER TABLE {$NAMESPACE}_daemon.daemon_log
+ ADD KEY (dateCreated);
diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1454,6 +1454,7 @@
'PhabricatorDaemonEventListener' => 'applications/daemon/event/PhabricatorDaemonEventListener.php',
'PhabricatorDaemonLog' => 'applications/daemon/storage/PhabricatorDaemonLog.php',
'PhabricatorDaemonLogEvent' => 'applications/daemon/storage/PhabricatorDaemonLogEvent.php',
+ 'PhabricatorDaemonLogEventGarbageCollector' => 'applications/daemon/garbagecollector/PhabricatorDaemonLogEventGarbageCollector.php',
'PhabricatorDaemonLogEventViewController' => 'applications/daemon/controller/PhabricatorDaemonLogEventViewController.php',
'PhabricatorDaemonLogEventsView' => 'applications/daemon/view/PhabricatorDaemonLogEventsView.php',
'PhabricatorDaemonLogGarbageCollector' => 'applications/daemon/garbagecollector/PhabricatorDaemonLogGarbageCollector.php',
@@ -4264,6 +4265,7 @@
1 => 'PhabricatorPolicyInterface',
),
'PhabricatorDaemonLogEvent' => 'PhabricatorDaemonDAO',
+ 'PhabricatorDaemonLogEventGarbageCollector' => 'PhabricatorGarbageCollector',
'PhabricatorDaemonLogEventViewController' => 'PhabricatorDaemonController',
'PhabricatorDaemonLogEventsView' => 'AphrontView',
'PhabricatorDaemonLogGarbageCollector' => 'PhabricatorGarbageCollector',
diff --git a/src/applications/daemon/garbagecollector/PhabricatorDaemonLogGarbageCollector.php b/src/applications/daemon/garbagecollector/PhabricatorDaemonLogEventGarbageCollector.php
copy from src/applications/daemon/garbagecollector/PhabricatorDaemonLogGarbageCollector.php
copy to src/applications/daemon/garbagecollector/PhabricatorDaemonLogEventGarbageCollector.php
--- a/src/applications/daemon/garbagecollector/PhabricatorDaemonLogGarbageCollector.php
+++ b/src/applications/daemon/garbagecollector/PhabricatorDaemonLogEventGarbageCollector.php
@@ -1,6 +1,6 @@
<?php
-final class PhabricatorDaemonLogGarbageCollector
+final class PhabricatorDaemonLogEventGarbageCollector
extends PhabricatorGarbageCollector {
public function collectGarbage() {
diff --git a/src/applications/daemon/garbagecollector/PhabricatorDaemonLogGarbageCollector.php b/src/applications/daemon/garbagecollector/PhabricatorDaemonLogGarbageCollector.php
--- a/src/applications/daemon/garbagecollector/PhabricatorDaemonLogGarbageCollector.php
+++ b/src/applications/daemon/garbagecollector/PhabricatorDaemonLogGarbageCollector.php
@@ -9,14 +9,15 @@
return false;
}
- $table = new PhabricatorDaemonLogEvent();
+ $table = new PhabricatorDaemonLog();
$conn_w = $table->establishConnection('w');
queryfx(
$conn_w,
- 'DELETE FROM %T WHERE epoch < %d LIMIT 100',
+ 'DELETE FROM %T WHERE dateCreated < %d AND status != %s LIMIT 100',
$table->getTableName(),
- time() - $ttl);
+ time() - $ttl,
+ PhabricatorDaemonLog::STATUS_RUNNING);
return ($conn_w->getAffectedRows() == 100);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 20, 10:33 PM (4 w, 18 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6737557
Default Alt Text
D9610.id23034.diff (3 KB)
Attached To
Mode
D9610: Garbage collect daemon logs
Attached
Detach File
Event Timeline
Log In to Comment