1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-03 12:12: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:
epriestley 2017-02-27 12:08:54 -08:00
parent 05377bea19
commit a9cd146745

View file

@ -129,7 +129,16 @@ final class PhabricatorOwnersPackageQuery
}
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;
@ -361,13 +370,6 @@ final class PhabricatorOwnersPackageQuery
$best_match = null;
$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);
foreach ($repository_paths as $package_path) {
$strength = $package_path->getPathMatchStrength(