mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-23 07:12:41 +01:00
Use LiskDAOSet's loadRelativeEdges with ReleephRequest
Summary: `ReleephRequest`s contain the PHID for a `PhabricatorRepositoryCommit`, and commits have an edge to a `DifferentialRevision`. Commits are loaded with the `loadOneRelative()` method that loads the commits for every `ReleephRequest` in a `LiskDAOSet`, but the edges are loaded indivdually. A page with N RQs on it makes one DB query for the commits, but N queries for the `TYPE_COMMIT_HAS_DREV` edges. This diff uses `loadRelativeEdges` instead to load the edges all in one query. Test Plan: {F42290} Reviewers: wez, epriestley Reviewed By: epriestley CC: epriestley, vrana, aran Maniphest Tasks: T2714 Differential Revision: https://secure.phabricator.com/D5820
This commit is contained in:
parent
30b15e094c
commit
5c4a9ac9e5
1 changed files with 7 additions and 4 deletions
|
@ -228,10 +228,13 @@ final class ReleephRequest extends ReleephDAO {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function loadRequestCommitDiffPHID() {
|
public function loadRequestCommitDiffPHID() {
|
||||||
$revision_phid = PhabricatorEdgeQuery::loadDestinationPHIDs(
|
$commit = $this->loadPhabricatorRepositoryCommit();
|
||||||
$this->getRequestCommitPHID(),
|
if ($commit) {
|
||||||
PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV);
|
$edges = $this
|
||||||
return reset($revision_phid);
|
->loadPhabricatorRepositoryCommit()
|
||||||
|
->loadRelativeEdges(PhabricatorEdgeConfig::TYPE_COMMIT_HAS_DREV);
|
||||||
|
return head(array_keys($edges));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue