mirror of
https://github.com/anyproto/any-sync.git
synced 2025-06-08 05:57:03 +09:00
Start peermanager as a component
This commit is contained in:
parent
850a4a632e
commit
54cfaae3ce
1 changed files with 11 additions and 0 deletions
|
@ -236,6 +236,17 @@ func (s *spaceService) getSpaceStorageFromRemote(ctx context.Context, id string)
|
|||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
peerApp := s.app.ChildApp().Register(pm)
|
||||
err = peerApp.Start(ctx)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
defer func() {
|
||||
err := peerApp.Close(ctx)
|
||||
if err != nil {
|
||||
log.Warn("failed to close peer manager")
|
||||
}
|
||||
}()
|
||||
var peers []peer.Peer
|
||||
for {
|
||||
peers, err = pm.GetResponsiblePeers(ctx)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue