Skip to content

Commit

Permalink
Fix merging of pending and running client types
Browse files Browse the repository at this point in the history
  • Loading branch information
denis-yuen committed Nov 4, 2015
1 parent 6f5d03e commit a800bb9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,10 @@ public Void call() throws Exception {
// determine mix of VMs required
Map<String, Integer> clientTypes = new HashMap<>();
for(Job j : pendingJobs){
clientTypes.merge(j.getFlavour(), 1, (k,v) -> (v+1));
clientTypes.compute(j.getFlavour(), (k, v) -> (v == null ? 1 : v + 1));
}
for(Job j : runningJobs){
clientTypes.merge(j.getFlavour(), 1, (k,v) -> (v+1));
clientTypes.compute(j.getFlavour(), (k,v) -> (v == null? 1 : v+1));
}

// cap the number of VMs
Expand Down

0 comments on commit a800bb9

Please sign in to comment.