Skip to content

Commit

Permalink
timings
Browse files Browse the repository at this point in the history
  • Loading branch information
tibvdm committed Apr 22, 2024
1 parent 1279d26 commit 02397bc
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions app/controllers/mpa/pept2filtered_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,19 @@ def pept2filtered

end_index_time = get_time - index_time

taxa_filter_ids.each_slice(5000) do |taxa_slice|
taxa_slice = Taxon.where(id: taxa_slice).where(valid_taxon: 1).pluck(:id).to_set
filter_time = get_time

next if taxa_slice.empty?
taxa_filter_ids.to_set

@response.each do |result|
result["taxa"] = result["taxa"].select { |taxon_id| taxa_slice.include?(taxon_id) }.uniq
end
@response.each do |result|
result["taxa"] = result["taxa"] & taxa_slice
end

@timings = end_index_time
end_filter_time = get_time - filter_time

@timings = {
index_time: end_index_time,
filter_time: end_filter_time
}
end
end

0 comments on commit 02397bc

Please sign in to comment.