Skip to content

Commit

Permalink
Merge pull request #1044 from griffithlab/background_jobs
Browse files Browse the repository at this point in the history
More bugfixes to the background jobs
  • Loading branch information
acoffman authored Apr 25, 2024
2 parents 2195a6a + ae3df83 commit fc82652
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion server/app/jobs/flag_duplicate_allele_registry_ids.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def perform
variants = Variant.where(id: ids)
variants.each do |variant|
if variant.flags.select{|f| f.state == 'open' && f.open_activity.note =~ /This Variant may be a duplicate and may need to be deprecated/ && f.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
Activities::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: variant,
organization_id: nil,
Expand Down
4 changes: 2 additions & 2 deletions server/app/lib/importer/disease_ontology_mirror.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ def url_from_doid(doid)
def add_flags(disease, text)
civicbot_user = User.find(385)
(disease.evidence_items + disease.assertions).each do |obj|
if obj.flags.select{|f| f.state == 'open' && f.open_activity.note == text && c.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
if obj.flags.select{|f| f.state == 'open' && f.open_activity.note == text && f.open_activity.user_id == 385}.count == 0
Activities::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: obj,
organization_id: nil,
Expand Down
6 changes: 3 additions & 3 deletions server/app/lib/importer/sequence_ontology_mirror.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ def process_obsolete_terms
text += " Replaced by #{term['replaced_by']}."
end
obsolete_type.variants.each do |variant|
if variant.flags.select{|f| f.state == 'open' && f.comments.select{|c| c.text =~ /obsolete Sequence Ontology term/ && c.user_id == 385}.count > 0}.count == 0
Actions::FlagEntity.new(
if variant.flags.select{|f| f.state == 'open' && f.open_activity.note =~ /obsolete Sequence Ontology term/ && f.open_activity.user_id == 385}.count == 0
Activities::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: variant,
organization_id: nil,
comment: text
note: text
).perform
end
end
Expand Down
2 changes: 1 addition & 1 deletion server/app/lib/scrapers/human_phenotype_ontology.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def self.update
civicbot_user = User.find(385)
(p.evidence_items + p.assertions).each do |obj|
if obj.flags.select{|f| f.state == 'open' && f.open_activity.note =~ /deprecated HPO term/ && f.open_activity.user_id == 385}.count == 0
Activity::FlagEntity.new(
Activities::FlagEntity.new(
flagging_user: civicbot_user,
flaggable: obj,
organization_id: nil,
Expand Down

0 comments on commit fc82652

Please sign in to comment.