From dc2d87059b29b9dfe8838c2e0b07f4074f599112 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 13 May 2016 06:47:19 -0700 Subject: [PATCH] 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 --- .../DiffusionRepositoryURIsIndexEngineExtension.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/applications/diffusion/engineextension/DiffusionRepositoryURIsIndexEngineExtension.php b/src/applications/diffusion/engineextension/DiffusionRepositoryURIsIndexEngineExtension.php index 2c1e49b3da..7fb12b6b6a 100644 --- a/src/applications/diffusion/engineextension/DiffusionRepositoryURIsIndexEngineExtension.php +++ b/src/applications/diffusion/engineextension/DiffusionRepositoryURIsIndexEngineExtension.php @@ -16,6 +16,18 @@ final class DiffusionRepositoryURIsIndexEngineExtension public function indexObject( PhabricatorIndexEngine $engine, $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(); } -- 2.51.2