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

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

[fix] display the peer % progress during sync

parent 27430439
......@@ -259,12 +259,16 @@ export class RemoteSynchronizer extends AbstractSynchronizer {
async syncPeers(fullSync: boolean, to?: number): Promise<void> {
const peers = await this.node.getPeers()
for (const p of peers) {
for (let i = 0; i < peers.length; i++) {
const peer = PeerDTO.fromJSONObject(peers[i])
this.watcher.writeStatus('Peer ' + peer.pubkey)
this.watcher.peersPercent(Math.ceil(i / peers.length * 100))
try {
await this.PeeringService.submitP(DBPeer.fromPeerDTO(PeerDTO.fromJSONObject(p)))
await this.PeeringService.submitP(DBPeer.fromPeerDTO(peer))
} catch (e) {
}
}
this.watcher.peersPercent(100)
}
async syncSandbox(): Promise<void> {
......
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