[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class FeedPublisherHTTPWorker extends FeedPushWorker { 4 5 protected function doWork() { 6 $story = $this->loadFeedStory(); 7 $data = $story->getStoryData(); 8 9 $uri = idx($this->getTaskData(), 'uri'); 10 $valid_uris = PhabricatorEnv::getEnvConfig('feed.http-hooks'); 11 if (!in_array($uri, $valid_uris)) { 12 throw new PhabricatorWorkerPermanentFailureException(); 13 } 14 15 $post_data = array( 16 'storyID' => $data->getID(), 17 'storyType' => $data->getStoryType(), 18 'storyData' => $data->getStoryData(), 19 'storyAuthorPHID' => $data->getAuthorPHID(), 20 'storyText' => $story->renderText(), 21 'epoch' => $data->getEpoch(), 22 ); 23 24 id(new HTTPSFuture($uri, $post_data)) 25 ->setMethod('POST') 26 ->setTimeout(30) 27 ->resolvex(); 28 } 29 30 public function getWaitBeforeRetry(PhabricatorWorkerTask $task) { 31 return max($task->getFailureCount(), 1) * 60; 32 } 33 34 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |