diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-03-26 11:41:00 -0400 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-03-26 11:41:00 -0400 |
commit | d9722766be649b6266a556549fd6e553874dfdfb (patch) | |
tree | bc1eda943bdfffeb4ea74e3b85f695ce66dc9e05 /tools | |
parent | 183b38854c8efef2af9e4118060bc2dc4a84befc (diff) |
infinite loop fix
Diffstat (limited to 'tools')
-rw-r--r-- | tools/schedule.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/schedule.js b/tools/schedule.js index c110bb3..4fe730e 100644 --- a/tools/schedule.js +++ b/tools/schedule.js @@ -105,7 +105,9 @@ exports.Queue = function(delayms, maxExport, call){ } // Step 4: Shallow copy job array, and sort by job.wacc. - for (let job of jobq.slice().sort((el, ne) => el.wacc-ne.wacc)){ + let sort = jobq.slice().sort((el, ne) => el.wacc-ne.wacc); + // not inline because when inline, runs over and over again (loop) + for (let job of sort){ // Step 5: Iterate through array (high->low), and subtract 1 until the length of output is num. if (dequeued.length == num || job.data.length == 0) break; job.wacc--; |