Commit eae94e0f authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] sync: let Duniter exit if an error occur during blocks retrieval

parent 2bb8f811
......@@ -143,7 +143,7 @@ export class Synchroniser extends stream.Duplex {
!cautious,
this.watcher)
downloader.start()
const startp = downloader.start()
let lastPullBlock:BlockDTO|null = null;
let syncStrategy = this.syncStrategy
......@@ -242,7 +242,10 @@ export class Synchroniser extends stream.Duplex {
})(this.server, this.watcher, this.dal, this.BlockchainService)
const logInterval = setInterval(() => this.logRemaining(to), EVAL_REMAINING_INTERVAL);
await dao.pull(this.conf, this.logger)
await Promise.all([
dao.pull(this.conf, this.logger),
await startp // In case of errors, will stop the process
])
// Finished blocks
this.watcher.downloadPercent(100.0);
......
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