mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +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:
parent
0cd698b674
commit
36fa347bcc
1 changed files with 8 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright 2012 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (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(
|
||||
PhabricatorSearchAbstractDocument $document) {
|
||||
$engine = PhabricatorSearchEngineSelector::newSelector()->newEngine();
|
||||
$engine->reindexAbstractDocument($document);
|
||||
try {
|
||||
$engine->reindexAbstractDocument($document);
|
||||
} catch (Exception $ex) {
|
||||
$phid = $document->getPHID();
|
||||
$class = get_class($engine);
|
||||
phlog("Unable to index document {$phid} by engine {$class}.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue