Skip to content

Commit

Permalink
Merge pull request #451 from ualbertalib/fix/nil_entity
Browse files Browse the repository at this point in the history
Fix/nil entity
  • Loading branch information
lagoan authored Jun 25, 2024
2 parents 5cf411b + f30385d commit 5ae8d43
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
9 changes: 5 additions & 4 deletions lib/pushmi_pullyu/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down

0 comments on commit 5ae8d43

Please sign in to comment.