-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: master
Are you sure you want to change the base?
Conversation
b26bbe2
to
ac82f59
Compare
|
||
# 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) |
There was a problem hiding this comment.
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
app/workers/fetch_graph_worker.rb
Outdated
path = "./tmp/failed_fetch/#{pid}.txt" | ||
|
||
# SEARCH: Look for works to create a link | ||
work = ActiveFedora::Base.find(pid) |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
app/workers/fetch_graph_worker.rb
Outdated
|
||
# 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) |
There was a problem hiding this comment.
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
?
97508bd
to
931e400
Compare
FEATURE:
Add in a mailer to the fetch failed for Graph Worker on theCV
and report to theuser
andmetadata
team.fixes #1560
NOTE:
Need to ask about the idea of(For now, just focus on the sending capability and can work on enhancement later on)institution
on this ticket to separate the out the failed fetch notify