Page MenuHomePhabricator

D9610.id.diff
No OneTemporary

D9610.id.diff

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',
@@ -4265,6 +4266,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

Mime Type
text/plain
Expires
Thu, Oct 24, 8:48 PM (3 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6744240
Default Alt Text
D9610.id.diff (3 KB)

Event Timeline