mirror of
https://github.com/gchq/CyberChef
synced 2025-01-08 10:38:46 +00:00
Don't create more ChefWorkers than we need.
This commit is contained in:
parent
28182713bf
commit
689d08416b
1 changed files with 6 additions and 1 deletions
|
@ -148,6 +148,7 @@ class WorkerWaiter {
|
||||||
case "bakeError":
|
case "bakeError":
|
||||||
if (!r.data.hasOwnProperty("progress")) this.app.handleError(r.data.error);
|
if (!r.data.hasOwnProperty("progress")) this.app.handleError(r.data.error);
|
||||||
this.manager.output.updateOutputError(r.data.error, inputNum, r.data.progress);
|
this.manager.output.updateOutputError(r.data.error, inputNum, r.data.progress);
|
||||||
|
this.app.progress = r.data.progress;
|
||||||
this.workerFinished(currentWorker);
|
this.workerFinished(currentWorker);
|
||||||
// do more here
|
// do more here
|
||||||
break;
|
break;
|
||||||
|
@ -378,7 +379,11 @@ class WorkerWaiter {
|
||||||
this.progress = progress;
|
this.progress = progress;
|
||||||
this.step = step;
|
this.step = step;
|
||||||
|
|
||||||
for (let i = 0; i < this.maxWorkers; i++) {
|
let numWorkers = this.maxWorkers;
|
||||||
|
if (this.inputs.length < numWorkers) {
|
||||||
|
numWorkers = this.inputs.length;
|
||||||
|
}
|
||||||
|
for (let i = 0; i < numWorkers; i++) {
|
||||||
const workerIdx = this.addChefWorker();
|
const workerIdx = this.addChefWorker();
|
||||||
if (workerIdx === -1) break;
|
if (workerIdx === -1) break;
|
||||||
this.bakeNextInput(workerIdx);
|
this.bakeNextInput(workerIdx);
|
||||||
|
|
Loading…
Reference in a new issue