Chad has uploaded a new change for review. https://gerrit.wikimedia.org/r/113469
Change subject: Make failure messages less spammy ...................................................................... Make failure messages less spammy Batch them in one message per failure event, rather than per document/ page/etc per event. Change-Id: If07c0081d736ddf9243fd2b7722be0bec162dd49 --- M includes/BuildDocument/RedirectsAndIncomingLinks.php M includes/OtherIndexes.php M includes/Updater.php 3 files changed, 17 insertions(+), 14 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CirrusSearch refs/changes/69/113469/1 diff --git a/includes/BuildDocument/RedirectsAndIncomingLinks.php b/includes/BuildDocument/RedirectsAndIncomingLinks.php index b62e592..f4a74c7 100644 --- a/includes/BuildDocument/RedirectsAndIncomingLinks.php +++ b/includes/BuildDocument/RedirectsAndIncomingLinks.php @@ -111,10 +111,11 @@ } catch ( \Elastica\Exception\ExceptionInterface $e ) { // Note that we still return the pages and execute the update here, we just complain $this->failure( $e ); - foreach ( $pages as $page ) { - $id = $page->getId(); - wfDebugLog( 'CirrusSearchChangeFailed', "Links: $id" ); - } + $pageIds = array_map( function( $page ) { + return $page->getId(); + }, $pages ); + wfDebugLog( 'CirrusSearchChangeFailed', 'Links for page ids: ' . + implode( ',', $pageIds ) ); } } } diff --git a/includes/OtherIndexes.php b/includes/OtherIndexes.php index 3db1173..83b9a68 100644 --- a/includes/OtherIndexes.php +++ b/includes/OtherIndexes.php @@ -184,10 +184,11 @@ $this->success(); } else { $this->failure( $e ); - foreach ( $titles as $title ) { - $id = $title->getArticleID(); - wfDebugLog( 'CirrusSearchChangeFailed', "Other Index $actionName: $id" ); - } + $articleIDs = array_map( function( $title ) { + return $title->getArticleID(); + }, $titles ); + wfDebugLog( 'CirrusSearchChangeFailed', 'Other Index $actionName for article ids: ' . + implode( ',', $pageIds ) ); } } } diff --git a/includes/Updater.php b/includes/Updater.php index 1c3a641..deff1a2 100644 --- a/includes/Updater.php +++ b/includes/Updater.php @@ -257,9 +257,11 @@ $this->success(); } else { $this->failure( $exception ); - foreach ( $documents as $document ) { - wfDebugLog( 'CirrusSearchChangeFailed', 'Update: ' . $document->getId() ); - } + $documentIds = array_map( function( $doc ) { + return $doc->getId(); + }, $documents ); + wfDebugLog( 'CirrusSearchChangeFailed', 'Update for doc ids: ' . + implode( ',', $documentIds ) ); } } @@ -446,9 +448,8 @@ } } catch ( \Elastica\Exception\ExceptionInterface $e ) { $this->failure( $e ); - foreach ( $ids as $id ) { - wfDebugLog( 'CirrusSearchChangeFailed', "Delete: $id" ); - } + wfDebugLog( 'CirrusSearchChangeFailed', 'Delete for ids: ' . + implode( ',', $pageIds ) ); } } -- To view, visit https://gerrit.wikimedia.org/r/113469 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If07c0081d736ddf9243fd2b7722be0bec162dd49 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CirrusSearch Gerrit-Branch: master Gerrit-Owner: Chad <ch...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits