From c5ddd0835ee0b10df1731703b6eb47afd8228a52 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Thu, 24 Dec 2020 15:46:32 +0100 Subject: [PATCH] fix index_document error message. #690 --- app/jobs/index_background_job.rb | 2 +- app/jobs/index_job.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/jobs/index_background_job.rb b/app/jobs/index_background_job.rb index 545248b30..94e218e27 100644 --- a/app/jobs/index_background_job.rb +++ b/app/jobs/index_background_job.rb @@ -11,6 +11,6 @@ class IndexBackgroundJob < ApplicationJob def perform(obj) response = obj.__elasticsearch__.index_document # Rails.logger.error "[Elasticsearch] Error indexing id #{response["_id"]} in index #{response["_index"]}" if response["result"] != "created" - Rails.logger.error "[Elasticsearch] Error #{response.inspect}" if response["result"] != "created" + Rails.logger.error "[Elasticsearch] Error #{response.inspect}" unless %w(created updated).include?(response["result"]) end end diff --git a/app/jobs/index_job.rb b/app/jobs/index_job.rb index 483a33b12..04d43bcd1 100644 --- a/app/jobs/index_job.rb +++ b/app/jobs/index_job.rb @@ -11,6 +11,6 @@ class IndexJob < ApplicationJob def perform(obj) response = obj.__elasticsearch__.index_document # Rails.logger.error "[Elasticsearch] Error indexing id #{response["_id"]} in index #{response["_index"]}" if response["result"] != "created" - Rails.logger.error "[Elasticsearch] Error #{response.inspect}" if response["result"] != "created" + Rails.logger.error "[Elasticsearch] Error #{response.inspect}" unless %w(created updated).include?(response["result"]) end end