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:
@@ -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}.");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user