1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-03 11:21:01 +01:00

Optimize displaying info about lint messages

Summary:
Log of some FB paths takes over 10 seconds.
We query two logs only to get accurate message about lint info which is not that important.

Test Plan: Displayed and clicked on it.

Reviewers: nh, epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4429
This commit is contained in:
vrana 2013-01-14 13:22:02 -08:00
parent 8d19d62b7f
commit f74c2bb138

View file

@ -133,25 +133,7 @@ final class DiffusionBrowseFileController extends DiffusionController {
return;
}
$file_history = DiffusionHistoryQuery::newFromDiffusionRequest(
$drequest)->setLimit(1)->loadHistory();
$lint_request = clone $drequest;
$lint_request->setCommit($branch->getLintCommit());
try {
$lint_history = DiffusionHistoryQuery::newFromDiffusionRequest(
$lint_request)->setLimit(1)->loadHistory();
} catch (Exception $ex) {
// This can happen if lintCommit is invalid.
$lint_history = null;
}
$this->lintCommit = '';
if (!$file_history || !$lint_history ||
reset($file_history)->getCommitIdentifier() !=
reset($lint_history)->getCommitIdentifier()) {
$this->lintCommit = $branch->getLintCommit();
}
$conn = id(new PhabricatorRepository())->establishConnection('r');
@ -355,21 +337,14 @@ final class DiffusionBrowseFileController extends DiffusionController {
} else if ($this->lintCommit === null) {
$lint_text = pht('Lint not Available');
} else if ($this->lintCommit) {
} else {
$lint_text = pht(
'Switch for %d Lint Message(s)',
'Show %d Lint Message(s)',
count($this->lintMessages));
$href = $this->getDiffusionRequest()->generateURI(array(
'action' => 'browse',
'commit' => $this->lintCommit,
))->alter('lint', '');
} else if (!$this->lintMessages) {
$lint_text = pht('No Lint Messages');
} else {
$lint_text = pht('Show %d Lint Message(s)', count($this->lintMessages));
$href = $base_uri->alter('lint', '');
}
$lint_button = $this->createViewAction(