1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-30 10:42:41 +01:00

Fix an issue with URI index updates from the daemons

Summary:
Ref T10923. This extension needs to load a little more data (with `needURIs`) to function correctly now.

(There's a recent migration does this, so indexes got updated correctly when it ran, so it hasn't been obvious that they weren't getting updated properly after that.)

Test Plan: Made an arbitrary edit to a repository, observed no more error in daemon logs.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10923

Differential Revision: https://secure.phabricator.com/D15908
This commit is contained in:
epriestley 2016-05-13 06:47:19 -07:00
parent e5f2ccc57f
commit dc2d87059b

View file

@ -16,6 +16,18 @@ final class DiffusionRepositoryURIsIndexEngineExtension
public function indexObject( public function indexObject(
PhabricatorIndexEngine $engine, PhabricatorIndexEngine $engine,
$object) { $object) {
// Reload the repository to pick up URIs, which we need in order to update
// the URI index.
$object = id(new PhabricatorRepositoryQuery())
->setViewer(PhabricatorUser::getOmnipotentUser())
->withPHIDs(array($object->getPHID()))
->needURIs(true)
->executeOne();
if (!$object) {
return;
}
$object->updateURIIndex(); $object->updateURIIndex();
} }