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

Add in a mailing system for fetching failed CV #3189

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

lamtu1
Copy link
Contributor

@lamtu1 lamtu1 commented Nov 4, 2024

FEATURE: Add in a mailer to the fetch failed for Graph Worker on the CV and report to the user and metadata team.

fixes #1560

NOTE: Need to ask about the idea of institution on this ticket to separate the out the failed fetch notify (For now, just focus on the sending capability and can work on enhancement later on)

@lamtu1 lamtu1 self-assigned this Nov 4, 2024
@lamtu1 lamtu1 marked this pull request as draft November 4, 2024 18:11
@lamtu1 lamtu1 added Enhancement Priority - High Issues that should be prioritized ahead of others - early timing in the project Features Issues related to building and enhancing features Communications labels Nov 4, 2024
@lamtu1 lamtu1 force-pushed the feature/notificationFetchFail branch from b26bbe2 to ac82f59 Compare November 7, 2024 23:21
@lamtu1 lamtu1 marked this pull request as ready for review January 14, 2025 22:04

# GET: Get the id from the txt file and send email to both user and metadata team
pid = filename.to_s.gsub('.txt', '')
work = ActiveFedora::Base.find(pid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SolrDocument should have the depositor

path = "./tmp/failed_fetch/#{pid}.txt"

# SEARCH: Look for works to create a link
work = ActiveFedora::Base.find(pid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm pretty sure you can find the path w/ a solr document, that would be faster.

puts 'Running OregonDigital::FailedFetchNotification'

# MAILER: Disable mailer so Failed Fetch won't send out email while running check
ActionMailer::Base.perform_deliveries = false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't need to disable and re-enable delivery, right?

@@ -0,0 +1,13 @@
# frozen_string_literal:true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we get some more specs, particularly dealing with storing and retrieving stuff in ./tmp?


require 'zip'

namespace :oregon_digital do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use a similar architecture to Linda's review queue daily notification solution? #1562 #3237
A single file can just store the pids and we use a helper lib object to fetch the solrdocs for the pids, generate a user map & batch all the emails together per user.
A running batch could create a list of pid/links for the metadeities .
It would help on disk clutter, simplify #store_failed_fetch, speed up individual lookups (SolrDocument.find can take many pids at once), and keep code consistency


# TODO: WILL INTEGRATE THIS WHEN REDOING EMAILING FOR THESE JOBS
# def fetch_failed_callback(user, val)
# Hyrax.config.callback.run(:ld_fetch_failure, user, val.rdf_subject.value)
# end

def fetch_failed_graph(val)
def fetch_failed_graph(val, _pid)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we passing _pid?

@lamtu1 lamtu1 force-pushed the feature/notificationFetchFail branch from 97508bd to 931e400 Compare January 29, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Communications Enhancement Features Issues related to building and enhancing features Priority - High Issues that should be prioritized ahead of others - early timing in the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Notifications] Failed fetch jobs
2 participants