Skip to content
Snippets Groups Projects
Commit 4acfe365 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

Revert "[fix] #1256force sync for cancelWork job"

This reverts commit 9871890e.
parent 9871890e
Branches
Tags
1 merge request!1238Resolve "the 1.6.15 and 1.6.16 versions never starts the calculation of blocks"
...@@ -67,8 +67,8 @@ export class WorkerFarm { ...@@ -67,8 +67,8 @@ export class WorkerFarm {
/** /**
* Eventually stops the engine PoW if one was computing * Eventually stops the engine PoW if one was computing
*/ */
async stopPoW() { stopPoW() {
this.stopPromise = querablep(Promise.resolve(this.theEngine.cancel())) this.stopPromise = querablep(this.theEngine.cancel())
return this.stopPromise; return this.stopPromise;
} }
...@@ -133,10 +133,10 @@ export class BlockProver { ...@@ -133,10 +133,10 @@ export class BlockProver {
if (this.workerFarmPromise) { if (this.workerFarmPromise) {
let farm = await this.getWorker(); let farm = await this.getWorker();
if (farm.isComputing() && !farm.isStopping()) { if (farm.isComputing() && !farm.isStopping()) {
Promise.resolve(farm.stopPoW()) await farm.stopPoW()
} else { } else {
// We force the stop anyway, just to be sure // We force the stop anyway, just to be sure
Promise.resolve(farm.stopPoW()) await farm.stopPoW()
} }
if (this.waitResolve) { if (this.waitResolve) {
this.waitResolve(); this.waitResolve();
......
...@@ -33,11 +33,11 @@ export class PowEngine { ...@@ -33,11 +33,11 @@ export class PowEngine {
} }
async prove(stuff:any) { async prove(stuff:any) {
Promise.all([this.cluster.cancelWork()]) this.cluster.cancelWork()
return await this.cluster.proveByWorkers(stuff) return await this.cluster.proveByWorkers(stuff)
} }
async cancel() { cancel() {
return this.cluster.cancelWork() return this.cluster.cancelWork()
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment