From 4fde8d201b089587aef027627cc5490a3671a884 Mon Sep 17 00:00:00 2001 From: Holden Rohrer Date: Tue, 11 Feb 2020 20:28:08 +0000 Subject: no longer sends `undefined` char with job pad step --- tools/schedule.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/schedule.js b/tools/schedule.js index dfbe854..d8509b8 100644 --- a/tools/schedule.js +++ b/tools/schedule.js @@ -104,7 +104,7 @@ exports.Queue = function(delayms, maxExport, call){ // Step 4: Shallow copy job array, and sort by job.wacc. for (job of jobq.slice().sort((el, ne) => el.wacc-ne.wacc)){ // Step 5: Iterate through array (high->low), and subtract 1 until the length of output is num. - if (dequeued.length == num) break; + if (dequeued.length == num || job.data.length == 0) break; job.wacc--; dequeued.push(job.data.pop()); } -- cgit