Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2890996
PhabricatorMetaMTAWorker.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorMetaMTAWorker.php
View Options
<?php
final
class
PhabricatorMetaMTAWorker
extends
PhabricatorWorker
{
public
function
getMaximumRetryCount
(
)
{
return
250
;
}
public
function
getWaitBeforeRetry
(
PhabricatorWorkerTask
$task
)
{
return
(
$task
->
getFailureCount
(
)
*
15
)
;
}
protected
function
doWork
(
)
{
$message
=
$this
->
loadMessage
(
)
;
if
(
$message
->
getStatus
(
)
!=
PhabricatorMailOutboundStatus
::
STATUS_QUEUE
)
{
return
;
}
try
{
$message
->
sendNow
(
)
;
}
catch
(
PhabricatorMetaMTAPermanentFailureException
$ex
)
{
// If the mailer fails permanently, fail this task permanently.
throw
new
PhabricatorWorkerPermanentFailureException
(
$ex
->
getMessage
(
)
)
;
}
}
private
function
loadMessage
(
)
{
$message_id
=
$this
->
getTaskData
(
)
;
$message
=
id
(
new
PhabricatorMetaMTAMail
(
)
)
->
load
(
$message_id
)
;
if
(
!
$message
)
{
throw
new
PhabricatorWorkerPermanentFailureException
(
pht
(
'Unable to load mail message (with ID "%s") while preparing to '
.
'deliver it.'
,
$message_id
)
)
;
}
return
$message
;
}
public
function
renderForDisplay
(
PhabricatorUser
$viewer
)
{
return
phutil_tag
(
'pre'
,
array
(
)
,
PlatformSymbols
::
getPlatformServerPath
(
)
.
' $ ./bin/mail show-outbound --id '
.
$this
->
getTaskData
(
)
)
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, Jan 19, 14:26 (3 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1112098
Default Alt Text
PhabricatorMetaMTAWorker.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment