diff --git a/CHANGELOG.md b/CHANGELOG.md index f4673e5..98fbb62 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 [#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) diff --git a/lib/pushmi_pullyu/cli.rb b/lib/pushmi_pullyu/cli.rb index bfa1277..076012b 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 @@ -225,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