Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15380597
D20335.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D20335.diff
View Options
diff --git a/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php b/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php
--- a/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php
+++ b/src/applications/dashboard/paneltype/PhabricatorDashboardQueryPanelType.php
@@ -106,9 +106,37 @@
}
}
+ $query->setReturnPartialResultsOnOverheat(true);
+
$results = $engine->executeQuery($query, $pager);
+ $results_view = $engine->renderResults($results, $saved);
+
+ $is_overheated = $query->getIsOverheated();
+ $overheated_view = null;
+ if ($is_overheated) {
+ $content = $results_view->getContent();
+
+ $overheated_message =
+ PhabricatorApplicationSearchController::newOverheatedError(
+ (bool)$results);
+
+ $overheated_warning = id(new PHUIInfoView())
+ ->setSeverity(PHUIInfoView::SEVERITY_WARNING)
+ ->setTitle(pht('Query Overheated'))
+ ->setErrors(
+ array(
+ $overheated_message,
+ ));
+
+ $overheated_box = id(new PHUIBoxView())
+ ->addClass('mmt mmb')
+ ->appendChild($overheated_warning);
+
+ $content = array($content, $overheated_box);
+ $results_view->setContent($content);
+ }
- return $engine->renderResults($results, $saved);
+ return $results_view;
}
public function adjustPanelHeader(
diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php
--- a/src/applications/search/controller/PhabricatorApplicationSearchController.php
+++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php
@@ -850,19 +850,31 @@
));
}
- private function newOverheatedView(array $results) {
- if ($results) {
+ public static function newOverheatedError($has_results) {
+ $overheated_link = phutil_tag(
+ 'a',
+ array(
+ 'href' => 'https://phurl.io/u/overheated',
+ 'target' => '_blank',
+ ),
+ pht('Learn More'));
+
+ if ($has_results) {
$message = pht(
- 'Most objects matching your query are not visible to you, so '.
- 'filtering results is taking a long time. Only some results are '.
- 'shown. Refine your query to find results more quickly.');
+ 'This query took too long, so only some results are shown. %s',
+ $overheated_link);
} else {
$message = pht(
- 'Most objects matching your query are not visible to you, so '.
- 'filtering results is taking a long time. Refine your query to '.
- 'find results more quickly.');
+ 'This query took too long. %s',
+ $overheated_link);
}
+ return $message;
+ }
+
+ private function newOverheatedView(array $results) {
+ $message = self::newOverheatedError((bool)$results);
+
return id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_WARNING)
->setFlush(true)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mar 15 2025, 3:48 AM (5 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7682320
Default Alt Text
D20335.diff (2 KB)
Attached To
Mode
D20335: When query panels overheat, degrade them and show a warning
Attached
Detach File
Event Timeline
Log In to Comment