From 15e5df1627587ed2adadc05f383f18b7306007ae Mon Sep 17 00:00:00 2001 From: Omar Rodriguez Arenas Date: Mon, 24 Jun 2024 12:46:18 -0600 Subject: [PATCH 1/3] Simplify entity get code This change simplifies the code that is used to wait for the next entity from the redis queue. This way, we can catch connection errors from redis. --- lib/pushmi_pullyu/cli.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/pushmi_pullyu/cli.rb b/lib/pushmi_pullyu/cli.rb index bfa1277..51c65a9 100644 --- a/lib/pushmi_pullyu/cli.rb +++ b/lib/pushmi_pullyu/cli.rb @@ -199,13 +199,14 @@ def rotate_logs def run_preservation_cycle begin entity = queue.wait_next_item - PushmiPullyu::Logging.log_preservation_attempt(entity, - queue.get_entity_ingestion_attempt(entity)) - return unless entity && entity[:type].present? && entity[:uuid].present? rescue StandardError => e log_exception(e) end + return unless entity && entity[:type].present? && entity[:uuid].present? + + PushmiPullyu::Logging.log_preservation_attempt(entity, + queue.get_entity_ingestion_attempt(entity)) # add additional information about the error context to errors that occur while processing this item. Rollbar.scoped(entity_uuid: entity[:uuid]) do # Download AIP from Jupiter, bag and tar AIP directory and cleanup after From d18e37d06765f832699f59a583aab82c55e677e9 Mon Sep 17 00:00:00 2001 From: Omar Rodriguez Arenas Date: Mon, 24 Jun 2024 12:58:13 -0600 Subject: [PATCH 2/3] Add CHANGELOG and cleanup log information --- CHANGELOG.md | 3 +++ lib/pushmi_pullyu/cli.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4673e5..4a4ea04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ PushmiPullyu is a Ruby application, whose primary job is to manage the flow of c The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and releases in PushmiPullyu adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Unreleased + - Simplify get entity code + ## [2.1.1] - Increase clarity of log files [#433](https://github.com/ualbertalib/pushmi_pullyu/issues/433) diff --git a/lib/pushmi_pullyu/cli.rb b/lib/pushmi_pullyu/cli.rb index 51c65a9..076012b 100644 --- a/lib/pushmi_pullyu/cli.rb +++ b/lib/pushmi_pullyu/cli.rb @@ -226,7 +226,7 @@ def run_preservation_cycle queue.add_entity_in_timeframe(entity) PushmiPullyu::Logging.log_preservation_fail_and_retry(entity, queue.get_entity_ingestion_attempt(entity), e) rescue PushmiPullyu::PreservationQueue::MaxDepositAttemptsReached => e - PushmiPullyu::Logging.log_preservation_failure(entity, queue.get_entity_ingestion_attempt(entity), e) + PushmiPullyu::Logging.log_preservation_failure(entity, PushmiPullyu.options[:ingestion_attempts], e) log_exception(e) end From f30385d9a0f1da1a6a3254de2ddfbc31850197dc Mon Sep 17 00:00:00 2001 From: Omar Rodriguez Arenas Date: Mon, 24 Jun 2024 12:59:50 -0600 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4a4ea04..98fbb62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and releases in PushmiPullyu adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased - - Simplify get entity code + - Simplify get entity code [#280](https://github.com/ualbertalib/pushmi_pullyu/issues/280) ## [2.1.1] - Increase clarity of log files [#433](https://github.com/ualbertalib/pushmi_pullyu/issues/433)