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

[fix] display the peer % progress during sync

parent 27430439
No related branches found
No related tags found
No related merge requests found
...@@ -259,12 +259,16 @@ export class RemoteSynchronizer extends AbstractSynchronizer { ...@@ -259,12 +259,16 @@ export class RemoteSynchronizer extends AbstractSynchronizer {
async syncPeers(fullSync: boolean, to?: number): Promise<void> { async syncPeers(fullSync: boolean, to?: number): Promise<void> {
const peers = await this.node.getPeers() 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 { try {
await this.PeeringService.submitP(DBPeer.fromPeerDTO(PeerDTO.fromJSONObject(p))) await this.PeeringService.submitP(DBPeer.fromPeerDTO(peer))
} catch (e) { } catch (e) {
} }
} }
this.watcher.peersPercent(100)
} }
async syncSandbox(): Promise<void> { async syncSandbox(): Promise<void> {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment