From 5122a751d4e0a8b525c8bad5b21268e162db8d14 Mon Sep 17 00:00:00 2001 From: Terry Brady Date: Mon, 25 Sep 2023 12:38:53 -0700 Subject: [PATCH] atom feed retry --- app/controllers/object_controller.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/controllers/object_controller.rb b/app/controllers/object_controller.rb index f78b2d613..e6f110bd8 100644 --- a/app/controllers/object_controller.rb +++ b/app/controllers/object_controller.rb @@ -99,6 +99,18 @@ def upload # rubocop:enable Lint/RescueException def recent + retries = 0 + begin + do_recent + rescue StandardError => e + # :nocov: + retries += 1 + retries > RETRY_LIMIT ? raise(e) : retry + # :nocov: + end + end + + def do_recent @collection_ark = params[:collection] collection = InvCollection.where(ark: @collection_ark).first render(status: 404, plain: '404 Not Found') && return if collection.nil? || collection.to_s == ''