Skip to content

Commit

Permalink
prevent duplicated child from being counted twice, example with topic…
Browse files Browse the repository at this point in the history
…_3307, WIP #45
  • Loading branch information
bryan-brancotte committed Apr 8, 2021
1 parent 18e7058 commit fa66e07
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/bio.tools.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ function biotool_api(){
job_length+=queue.length;
// create a callback caller that sum all descendant usage and call the actual callback
function call_callback(){
var total=0;
var total=0,
total_d={};
$.each(queue,function(i,e){
total+=e[field_name];
total_d[e.data.data.uri]=e[field_name];
});
for (var key in total_d){
total+=total_d[key];
}

This comment has been minimized.

Copy link
@matuskalas

matuskalas Apr 8, 2021

Member

Wow wow wow 😮, was it this simple? 😸

This comment has been minimized.

Copy link
@bryan-brancotte

bryan-brancotte Apr 8, 2021

Author Member

once spotted it was easy ;)

callback({
'descendants':queue.length,
'total':total
Expand Down

0 comments on commit fa66e07

Please sign in to comment.