Mise à jour de GitLab prévue ce samedi 23 octobre 2021 à partir de 9h00 CET

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
......@@ -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();
}
}
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