diff --git a/resources/sql/patches/069.heraldxscript.sql b/resources/sql/patches/069.heraldxscript.sql new file mode 100644 index 0000000000..753aa44bd1 --- /dev/null +++ b/resources/sql/patches/069.heraldxscript.sql @@ -0,0 +1,9 @@ +ALTER TABLE phabricator_herald.herald_transcript + ADD garbageCollected BOOL NOT NULL DEFAULT 0; + +UPDATE phabricator_herald.herald_transcript + SET garbageCollected = 1 + WHERE objectTranscript = ""; + +ALTER TABLE phabricator_herald.herald_transcript + ADD KEY (garbageCollected, time); diff --git a/src/infrastructure/daemon/garbagecollector/PhabricatorGarbageCollectorDaemon.php b/src/infrastructure/daemon/garbagecollector/PhabricatorGarbageCollectorDaemon.php index 4375c08034..4faad2c859 100644 --- a/src/infrastructure/daemon/garbagecollector/PhabricatorGarbageCollectorDaemon.php +++ b/src/infrastructure/daemon/garbagecollector/PhabricatorGarbageCollectorDaemon.php @@ -104,8 +104,9 @@ class PhabricatorGarbageCollectorDaemon extends PhabricatorDaemon { objectTranscript = "", ruleTranscripts = "", conditionTranscripts = "", - applyTranscripts = "" - WHERE `time` < %d AND objectTranscript != "" + applyTranscripts = "", + garbageCollected = 1 + WHERE garbageCollected = 0 AND `time` < %d LIMIT 100', $table->getTableName(), time() - $ttl);