Skip to content

Commit

Permalink
Merge pull request #219 from WormBase/276-hotfix/strain-contains
Browse files Browse the repository at this point in the history
return counts instead of data when # variations is large
  • Loading branch information
adamjohnwright authored May 7, 2020
2 parents 613978c + c33e01e commit 89f224a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/rest_api/classes/strain/widgets/contains.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@
:description "clones contained in the strain"})

(defn alleles [s]
{:data (when-let [vhs (:variation.strain/_strain s)]
(for [vh vhs
:let [variation (:variation/_strain vh)]]
(variation-core/process-variation variation (set []))))
:description "alleles contained in the strain"})
(let [vhs (:variation.strain/_strain s)]
{:data (if (< (count vhs) 3000)
(for [vh vhs
:let [variation (:variation/_strain vh)]]
(variation-core/process-variation variation (set []))))
:count (count vhs)
:description "alleles contained in the strain"}
))

(defn genes [s]
{:data (when-let [genes (:gene/_strain s)]
Expand Down

0 comments on commit 89f224a

Please sign in to comment.