From a96fd7febd65b663703f9c0d3c9e4449b2685559 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Mon, 2 Oct 2023 14:25:58 -0700 Subject: [PATCH 1/2] retry4 for inv_object --- app/models/inv_object.rb | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/app/models/inv_object.rb b/app/models/inv_object.rb index 763d4228c..a55c15f4d 100644 --- a/app/models/inv_object.rb +++ b/app/models/inv_object.rb @@ -57,9 +57,16 @@ def bytestream_uri3 # :nocov: def dua_exists? - !inv_duas.blank? + retries = 0 + begin + !inv_duas.blank? + # :nocov: + rescue StandardError => e + retries += 1 + retries > RETRY_LIMIT ? raise(e) : retry + end + # :nocov: end - # :nocov: # :nocov: @@ -82,11 +89,27 @@ def total_actual_size end def current_version - @current_version ||= inv_versions.order('number desc').first + retries = 0 + begin + @current_version ||= inv_versions.order('number desc').first + # :nocov: + rescue StandardError => e + retries += 1 + retries > RETRY_LIMIT ? raise(e) : retry + end + # :nocov: end def inv_collection - @inv_collection ||= inv_collections.first + retries = 0 + begin + @inv_collection ||= inv_collections.first + # :nocov: + rescue StandardError => e + retries += 1 + retries > RETRY_LIMIT ? raise(e) : retry + end + # :nocov: end def group From c7fa9e24cb2720c62d40ea89350fd25627d82859 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Mon, 2 Oct 2023 14:44:35 -0700 Subject: [PATCH 2/2] retry --- app/models/inv_object.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/models/inv_object.rb b/app/models/inv_object.rb index a55c15f4d..d0c5fd403 100644 --- a/app/models/inv_object.rb +++ b/app/models/inv_object.rb @@ -60,12 +60,10 @@ def dua_exists? retries = 0 begin !inv_duas.blank? - # :nocov: rescue StandardError => e retries += 1 retries > RETRY_LIMIT ? raise(e) : retry end - # :nocov: end # :nocov: