Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98144022
PhabricatorMetaMTAWorker.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 10, 06:28
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Jan 12, 06:28 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23500009
Attached To
rPH Phabricator
PhabricatorMetaMTAWorker.php
View Options
<?php
final
class
PhabricatorMetaMTAWorker
extends
PhabricatorWorker
{
public
function
getMaximumRetryCount
()
{
return
250
;
}
public
function
getWaitBeforeRetry
(
PhabricatorWorkerTask
$task
)
{
return
(
$task
->
getFailureCount
()
*
15
);
}
public
function
doWork
()
{
$message
=
$this
->
loadMessage
();
if
(!
$message
)
{
throw
new
PhabricatorWorkerPermanentFailureException
(
pht
(
'Unable to load message!'
));
}
if
(
$message
->
getStatus
()
!=
PhabricatorMetaMTAMail
::
STATUS_QUEUE
)
{
return
;
}
$id
=
$message
->
getID
();
$message
->
sendNow
();
// task failed if the message is still queued
// (instead of sent, void, or failed)
if
(
$message
->
getStatus
()
==
PhabricatorMetaMTAMail
::
STATUS_QUEUE
)
{
throw
new
Exception
(
pht
(
'Failed to send message.'
));
}
}
private
function
loadMessage
()
{
$message_id
=
$this
->
getTaskData
();
return
id
(
new
PhabricatorMetaMTAMail
())->
load
(
$message_id
);
}
public
function
renderForDisplay
(
PhabricatorUser
$viewer
)
{
return
phutil_tag
(
'pre'
,
array
(
),
'phabricator/ $ ./bin/mail show-outbound --id '
.
$this
->
getTaskData
());
}
}
Event Timeline
Log In to Comment