1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +09:00

Fix status checks

This commit is contained in:
mcrakhman 2023-08-21 21:32:31 +02:00
parent fdff2852c7
commit 35e87af12e
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -163,8 +163,9 @@ func (d *diffSyncer) onDiffError(ctx context.Context, p peer.Peer, cl spacesyncp
if err != spacesyncproto.ErrSpaceMissing {
if err == spacesyncproto.ErrSpaceIsDeleted {
d.syncStatus.SetNodesStatus(p.Id(), syncstatus.RemovedFromNetwork)
} else {
d.syncStatus.SetNodesStatus(p.Id(), syncstatus.ConnectionError)
}
d.syncStatus.SetNodesStatus(p.Id(), syncstatus.ConnectionError)
return err
}
// in case space is missing on peer, we should send push request
@ -172,10 +173,12 @@ func (d *diffSyncer) onDiffError(ctx context.Context, p peer.Peer, cl spacesyncp
if err != nil {
if err == coordinatorproto.ErrSpaceIsDeleted {
d.syncStatus.SetNodesStatus(p.Id(), syncstatus.RemovedFromNetwork)
} else {
d.syncStatus.SetNodesStatus(p.Id(), syncstatus.ConnectionError)
}
d.syncStatus.SetNodesStatus(p.Id(), syncstatus.ConnectionError)
return err
}
d.syncStatus.SetNodesStatus(p.Id(), syncstatus.Online)
return nil
}