From e7d896581a0c7568c8e98b3e7f53338765af4f2a Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Tue, 18 Dec 2018 13:25:47 +0100 Subject: [PATCH] handle ActiveRecord::StatementInvalid errors --- app/models/doi.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index ac53ae55c..3fb37e792 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -396,7 +396,7 @@ def self.import_by_day(options={}) # update_columns will NOT trigger validations and Elasticsearch indexing doi.update_columns(attrs) - rescue TypeError, NoMethodError, RuntimeError, ActiveRecord::LockWaitTimeout => error + rescue TypeError, NoMethodError, RuntimeError, ActiveRecord::StatementInvalid, ActiveRecord::LockWaitTimeout => error logger.error "[MySQL] Error importing metadata for " + doi.doi + ": " + error.message else count += 1 @@ -426,7 +426,7 @@ def self.import_by_day_missing(options={}) # update_columns will NOT trigger validations and Elasticsearch indexing doi.update_columns(attrs) - rescue TypeError, NoMethodError, RuntimeError, ActiveRecord::LockWaitTimeout => error + rescue TypeError, NoMethodError, RuntimeError, ActiveRecord::StatementInvalid, ActiveRecord::LockWaitTimeout => error logger.error "[MySQL] Error importing metadata for " + doi.doi + ": " + error.message else count += 1