1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Contain fallout from overheating feed queries on user profile pages

Summary: Fixes T13349. If the user profile page feed query overheats, it currently takes the whole page with it. Contain the blast to a smaller radius.

Test Plan: {F6633322}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T13349

Differential Revision: https://secure.phabricator.com/D20678
This commit is contained in:
epriestley 2019-07-23 16:01:32 -07:00
parent cd44925425
commit 6831ed94fa

View file

@ -252,15 +252,30 @@ final class PhabricatorPeopleProfileViewController
PhabricatorUser $user,
$viewer) {
$query = new PhabricatorFeedQuery();
$query->withFilterPHIDs(
array(
$user->getPHID(),
));
$query->setLimit(100);
$query->setViewer($viewer);
$query = id(new PhabricatorFeedQuery())
->setViewer($viewer)
->withFilterPHIDs(array($user->getPHID()))
->setLimit(100)
->setReturnPartialResultsOnOverheat(true);
$stories = $query->execute();
$overheated_view = null;
$is_overheated = $query->getIsOverheated();
if ($is_overheated) {
$overheated_message =
PhabricatorApplicationSearchController::newOverheatedError(
(bool)$stories);
$overheated_view = id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_WARNING)
->setTitle(pht('Query Overheated'))
->setErrors(
array(
$overheated_message,
));
}
$builder = new PhabricatorFeedBuilder($stories);
$builder->setUser($viewer);
$builder->setShowHovercards(true);
@ -268,8 +283,10 @@ final class PhabricatorPeopleProfileViewController
'requires but just a single step.'));
$view = $builder->buildView();
return $view->render();
return array(
$overheated_view,
$view->render(),
);
}
}