@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Minor, fix an MTA issue introduced in D3859.

Prior to D3859, getRequiredLeaseTime() was called before doWork(), which had the critical but subtle side effect of populating `$this->message`. Instead, make the population explicit. This restores email functionality.

Test Plan: ran `phd debug taskmaster` and verified email was delivered

Auditors: btrahan

+16 -7
+16 -7
src/applications/metamta/PhabricatorMetaMTAWorker.php
··· 22 22 private $message; 23 23 24 24 public function getWaitBeforeRetry(PhabricatorWorkerTask $task) { 25 - $message_id = $this->getTaskData(); 26 - 27 - $this->message = id(new PhabricatorMetaMTAMail())->loadOneWhere( 28 - 'id = %d', $this->getTaskData()); 29 - if (!$this->message) { 25 + $message = $this->loadMessage(); 26 + if (!$message) { 30 27 return null; 31 28 } 32 29 33 - $wait = max($this->message->getNextRetry() - time(), 0) + 15; 30 + $wait = max($message->getNextRetry() - time(), 0) + 15; 34 31 return $wait; 35 32 } 36 33 37 34 public function doWork() { 38 - $message = $this->message; 35 + $message = $this->loadMessage(); 39 36 if (!$message 40 37 || $message->getStatus() != PhabricatorMetaMTAMail::STATUS_QUEUE) { 41 38 return; ··· 48 45 throw new Exception('Failed to send message'); 49 46 } 50 47 } 48 + 49 + private function loadMessage() { 50 + if (!$this->message) { 51 + $message_id = $this->getTaskData(); 52 + $this->message = id(new PhabricatorMetaMTAMail())->load($message_id); 53 + if (!$this->message) { 54 + return null; 55 + } 56 + } 57 + return $this->message; 58 + } 59 + 51 60 }