Mise à jour effectuée, merci de nous signaler tout dysfonctionnement ! | Upgrade done, please let us know about any dysfunction!

Unverified Commit 9871890e authored by Éloïs's avatar Éloïs
Browse files

[fix] #1256force sync for cancelWork job

parent 700d6df3
......@@ -67,8 +67,8 @@ export class WorkerFarm {
/**
* Eventually stops the engine PoW if one was computing
*/
stopPoW() {
this.stopPromise = querablep(this.theEngine.cancel())
async stopPoW() {
this.stopPromise = querablep(Promise.resolve(this.theEngine.cancel()))
return this.stopPromise;
}
......@@ -133,10 +133,10 @@ export class BlockProver {
if (this.workerFarmPromise) {
let farm = await this.getWorker();
if (farm.isComputing() && !farm.isStopping()) {
await farm.stopPoW()
Promise.resolve(farm.stopPoW())
} else {
// We force the stop anyway, just to be sure
await farm.stopPoW()
Promise.resolve(farm.stopPoW())
}
if (this.waitResolve) {
this.waitResolve();
......
......@@ -33,11 +33,11 @@ export class PowEngine {
}
async prove(stuff:any) {
this.cluster.cancelWork()
Promise.all([this.cluster.cancelWork()])
return await this.cluster.proveByWorkers(stuff)
}
cancel() {
async cancel() {
return this.cluster.cancelWork()
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment