Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F115818694
FeedPublisherWorker.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
Tue, Jun 3, 05:23
Size
968 B
Mime Type
text/x-php
Expires
Thu, Jun 5, 05:23 (2 d)
Engine
blob
Format
Raw Data
Handle
26483992
Attached To
rPH Phabricator
FeedPublisherWorker.php
View Options
<?php
final
class
FeedPublisherWorker
extends
PhabricatorWorker
{
protected
function
doWork
()
{
$task_data
=
$this
->
getTaskData
();
$chrono_key
=
$task_data
[
'chrono_key'
];
$uri
=
$task_data
[
'uri'
];
$story
=
id
(
new
PhabricatorFeedStoryData
())
->
loadOneWhere
(
'chronologicalKey = %s'
,
$chrono_key
);
if
(!
$story
)
{
throw
new
PhabricatorWorkerPermanentFailureException
(
'Feed story was deleted.'
);
}
$data
=
array
(
'storyID'
=>
$story
->
getID
(),
'storyType'
=>
$story
->
getStoryType
(),
'storyData'
=>
$story
->
getStoryData
(),
'storyAuthorPHID'
=>
$story
->
getAuthorPHID
(),
'epoch'
=>
$story
->
getEpoch
(),
);
id
(
new
HTTPFuture
(
$uri
,
$data
))
->
setMethod
(
'POST'
)
->
setTimeout
(
30
)
->
resolvex
();
}
public
function
getWaitBeforeRetry
(
PhabricatorWorkerTask
$task
)
{
return
max
(
$task
->
getFailureCount
(),
1
)
*
60
;
}
}
Event Timeline
Log In to Comment