Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92699012
FeedPublisherHTTPWorker.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, Nov 22, 21:48
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Nov 24, 21:48 (2 d)
Engine
blob
Format
Raw Data
Handle
22489346
Attached To
rPH Phabricator
FeedPublisherHTTPWorker.php
View Options
<?php
final
class
FeedPublisherHTTPWorker
extends
FeedPushWorker
{
protected
function
doWork
()
{
if
(
PhabricatorEnv
::
getEnvConfig
(
'phabricator.silent'
))
{
// Don't invoke hooks in silent mode.
return
;
}
$story
=
$this
->
loadFeedStory
();
$data
=
$story
->
getStoryData
();
$uri
=
idx
(
$this
->
getTaskData
(),
'uri'
);
$valid_uris
=
PhabricatorEnv
::
getEnvConfig
(
'feed.http-hooks'
);
if
(!
in_array
(
$uri
,
$valid_uris
))
{
throw
new
PhabricatorWorkerPermanentFailureException
();
}
$post_data
=
array
(
'storyID'
=>
$data
->
getID
(),
'storyType'
=>
$data
->
getStoryType
(),
'storyData'
=>
$data
->
getStoryData
(),
'storyAuthorPHID'
=>
$data
->
getAuthorPHID
(),
'storyText'
=>
$story
->
renderText
(),
'epoch'
=>
$data
->
getEpoch
(),
);
id
(
new
HTTPSFuture
(
$uri
,
$post_data
))
->
setMethod
(
'POST'
)
->
setTimeout
(
30
)
->
resolvex
();
}
public
function
getWaitBeforeRetry
(
PhabricatorWorkerTask
$task
)
{
return
max
(
$task
->
getFailureCount
(),
1
)
*
60
;
}
}
Event Timeline
Log In to Comment