1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-14 02:42:40 +01:00

Log instead of fatal for reindexing documents

Summary:
We have some issues with Elastic search (or maybe it's SMC) causing that indexing sporadically doesn't work.
Throwing in indexing stops the workflow and is annoying.
Not indexing doesn't have fatal consequences for the user and we can (and probably should) postpone it.

Test Plan: Thrown, looked at log.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D3350
This commit is contained in:
vrana 2012-08-21 12:17:49 -07:00
parent 0cd698b674
commit 36fa347bcc

View file

@ -1,7 +1,7 @@
<?php <?php
/* /*
* Copyright 2011 Facebook, Inc. * Copyright 2012 Facebook, Inc.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -25,7 +25,13 @@ abstract class PhabricatorSearchDocumentIndexer {
final protected static function reindexAbstractDocument( final protected static function reindexAbstractDocument(
PhabricatorSearchAbstractDocument $document) { PhabricatorSearchAbstractDocument $document) {
$engine = PhabricatorSearchEngineSelector::newSelector()->newEngine(); $engine = PhabricatorSearchEngineSelector::newSelector()->newEngine();
try {
$engine->reindexAbstractDocument($document); $engine->reindexAbstractDocument($document);
} catch (Exception $ex) {
$phid = $document->getPHID();
$class = get_class($engine);
phlog("Unable to index document {$phid} by engine {$class}.");
}
} }
} }