Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/nil entity #451

Merged
merged 3 commits into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading