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

[fix] #1123 Start/Stop of PoW handler causes infinite loop on a restart of Duniter services

parent b1485e1b
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ export class PermanentProver {
}
allowedToStart() {
if (!this.permanencePromise || !this.permanencePromise.isFulfilled()) {
if (!this.permanencePromise || this.permanencePromise.isFulfilled()) {
this.startPermanence()
}
this.resolveContinuePromise(true);
......@@ -205,6 +205,7 @@ export class PermanentProver {
async stopEveryting() {
// First: avoid continuing the main loop
this.resolveContinuePromise(true)
this.continuePromise = new Promise((resolve) => this.resolveContinuePromise = resolve);
// Second: stop any started proof
await this.prover.cancel();
......
......@@ -31,6 +31,6 @@ export class Prover extends stream.Transform {
}
async stopService() {
this.permaProver.stopEveryting();
await this.permaProver.stopEveryting();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment