mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-04 04:32:43 +01:00
Filter archived packages out of the "controlling packages" query earlier
Summary: Ref T12319. Currently, we end up filtering archived packages out once for each path. This shows up on a profile from an install as meaningfully expensive: https://secure.phabricator.com/xhprof/profile/PHID-FILE-7kmpevyr22aih4s2vyln/?symbol=PhabricatorOwnersPackage::isArchived Instead, filter them out before we do any work. Test Plan: Viewed a revision, still saw packages. {F3425553} Reviewers: chad Reviewed By: chad Maniphest Tasks: T12319 Differential Revision: https://secure.phabricator.com/D17427
This commit is contained in:
parent
05377bea19
commit
a9cd146745
1 changed files with 10 additions and 8 deletions
|
@ -129,7 +129,16 @@ final class PhabricatorOwnersPackageQuery
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->controlMap) {
|
if ($this->controlMap) {
|
||||||
$this->controlResults += mpull($packages, null, 'getID');
|
foreach ($packages as $package) {
|
||||||
|
// If this package is archived, it's no longer a controlling package
|
||||||
|
// for any path. In particular, it can not force active packages with
|
||||||
|
// weak dominion to give up control.
|
||||||
|
if ($package->isArchived()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->controlResults[$package->getID()] = $package;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $packages;
|
return $packages;
|
||||||
|
@ -361,13 +370,6 @@ final class PhabricatorOwnersPackageQuery
|
||||||
$best_match = null;
|
$best_match = null;
|
||||||
$include = false;
|
$include = false;
|
||||||
|
|
||||||
// If this package is archived, it's no longer a controlling package
|
|
||||||
// for the given path. In particular, it can not force active packages
|
|
||||||
// with weak dominion to give up control.
|
|
||||||
if ($package->isArchived()) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$repository_paths = $package->getPathsForRepository($repository_phid);
|
$repository_paths = $package->getPathsForRepository($repository_phid);
|
||||||
foreach ($repository_paths as $package_path) {
|
foreach ($repository_paths as $package_path) {
|
||||||
$strength = $package_path->getPathMatchStrength(
|
$strength = $package_path->getPathMatchStrength(
|
||||||
|
|
Loading…
Reference in a new issue