Page MenuHomePhabricator

D18985.diff
No OneTemporary

D18985.diff

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
@@ -8739,6 +8739,7 @@
'PhabricatorMetaMTAMail' => array(
'PhabricatorMetaMTADAO',
'PhabricatorPolicyInterface',
+ 'PhabricatorDestructibleInterface',
),
'PhabricatorMetaMTAMailBody' => 'Phobject',
'PhabricatorMetaMTAMailBodyTestCase' => 'PhabricatorTestCase',
diff --git a/src/applications/metamta/garbagecollector/MetaMTAMailSentGarbageCollector.php b/src/applications/metamta/garbagecollector/MetaMTAMailSentGarbageCollector.php
--- a/src/applications/metamta/garbagecollector/MetaMTAMailSentGarbageCollector.php
+++ b/src/applications/metamta/garbagecollector/MetaMTAMailSentGarbageCollector.php
@@ -18,8 +18,9 @@
'dateCreated < %d LIMIT 100',
$this->getGarbageEpoch());
+ $engine = new PhabricatorDestructionEngine();
foreach ($mails as $mail) {
- $mail->delete();
+ $engine->destroyObject($mail);
}
return (count($mails) == 100);
diff --git a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
--- a/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
+++ b/src/applications/metamta/storage/PhabricatorMetaMTAMail.php
@@ -5,7 +5,9 @@
*/
final class PhabricatorMetaMTAMail
extends PhabricatorMetaMTADAO
- implements PhabricatorPolicyInterface {
+ implements
+ PhabricatorPolicyInterface,
+ PhabricatorDestructibleInterface {
const RETRY_DELAY = 5;
@@ -1041,20 +1043,6 @@
}
}
- public function delete() {
- $this->openTransaction();
- queryfx(
- $this->establishConnection('w'),
- 'DELETE FROM %T WHERE src = %s AND type = %d',
- PhabricatorEdgeConfig::TABLE_NAME_EDGE,
- $this->getPHID(),
- PhabricatorMetaMTAMailHasRecipientEdgeType::EDGECONST);
- $ret = parent::delete();
- $this->saveTransaction();
-
- return $ret;
- }
-
public function generateHeaders() {
$headers = array();
@@ -1306,4 +1294,12 @@
}
+/* -( PhabricatorDestructibleInterface )----------------------------------- */
+
+
+ public function destroyObjectPermanently(
+ PhabricatorDestructionEngine $engine) {
+ $this->delete();
+ }
+
}

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 8, 2:34 PM (4 d, 4 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7225940
Default Alt Text
D18985.diff (2 KB)

Event Timeline