mirror of
https://github.com/gchq/CyberChef.git
synced 2025-04-20 23:06:16 -04:00
Fix number of running workers not being correct.
(This needs some work!)
This commit is contained in:
parent
37428fbe3b
commit
61bc5436a2
1 changed files with 3 additions and 1 deletions
|
@ -71,11 +71,11 @@ class WorkerWaiter {
|
||||||
data: r.data,
|
data: r.data,
|
||||||
inputNum: r.data.inputNum
|
inputNum: r.data.inputNum
|
||||||
});
|
});
|
||||||
log.error(this.pendingInputs);
|
|
||||||
if (this.pendingInputs.length > 0) {
|
if (this.pendingInputs.length > 0) {
|
||||||
log.debug("Bake complete. Baking next input");
|
log.debug("Bake complete. Baking next input");
|
||||||
this.bakeNextInput(r.data.inputNum);
|
this.bakeNextInput(r.data.inputNum);
|
||||||
} else if (this.runningWorkers <= 0) {
|
} else if (this.runningWorkers <= 0) {
|
||||||
|
this.runningWorkers = 0;
|
||||||
this.recipeConfig = undefined;
|
this.recipeConfig = undefined;
|
||||||
this.options = undefined;
|
this.options = undefined;
|
||||||
this.progress = undefined;
|
this.progress = undefined;
|
||||||
|
@ -84,6 +84,7 @@ class WorkerWaiter {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "bakeError":
|
case "bakeError":
|
||||||
|
this.runningWorkers -= 1;
|
||||||
this.app.handleError(r.data);
|
this.app.handleError(r.data);
|
||||||
this.setBakingStatus(false);
|
this.setBakingStatus(false);
|
||||||
break;
|
break;
|
||||||
|
@ -213,6 +214,7 @@ class WorkerWaiter {
|
||||||
|
|
||||||
const initialInputs = input.slice(0, this.chefWorkers.length);
|
const initialInputs = input.slice(0, this.chefWorkers.length);
|
||||||
this.pendingInputs = input.slice(this.chefWorkers.length, input.length);
|
this.pendingInputs = input.slice(this.chefWorkers.length, input.length);
|
||||||
|
this.runningWorkers = 0;
|
||||||
|
|
||||||
for (let i = 0; i < initialInputs.length; i++) {
|
for (let i = 0; i < initialInputs.length; i++) {
|
||||||
this.runningWorkers += 1;
|
this.runningWorkers += 1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue