14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
# File 'app/jobs/biological_association_index_refresh_job.rb', line 14
def perform(rebuild_set: nil, user_id: nil)
raise TaxonWorks::Error, 'no set id to refresh job' if rebuild_set.blank?
q = BiologicalAssociationIndex
.where(rebuild_set:)
.includes(
biological_association: [
:biological_association_subject,
:biological_association_object,
:subject_biological_properties,
:object_biological_properties,
:sources,
:notes,
:identifiers,
{ biological_relationship: :uris }
]
)
q.find_each do |o|
begin
o.biological_association.set_biological_association_index
rescue => ex
ExceptionNotifier.notify_exception(
ex,
data: {
biological_association_id: o.biological_association_id,
project_id: o.project_id,
user_id:,
rebuild_set: }
)
raise
end
end
end
|