diff --git a/commonspace/syncstatus/syncstatus.go b/commonspace/syncstatus/syncstatus.go index 32c287fa..9c580fe6 100644 --- a/commonspace/syncstatus/syncstatus.go +++ b/commonspace/syncstatus/syncstatus.go @@ -3,11 +3,12 @@ package syncstatus import ( "context" "fmt" - "github.com/anyproto/any-sync/app" - "github.com/anyproto/any-sync/commonspace/spacestate" "sync" "time" + "github.com/anyproto/any-sync/app" + "github.com/anyproto/any-sync/commonspace/spacestate" + "github.com/anyproto/any-sync/app/logger" "github.com/anyproto/any-sync/commonspace/object/tree/treestorage" "github.com/anyproto/any-sync/commonspace/spacestorage" @@ -178,8 +179,9 @@ func (s *syncStatusService) update(ctx context.Context) (err error) { } s.treeStatusBuf = append(s.treeStatusBuf, treeStatus{treeId, treeHeads.syncStatus, treeHeads.heads}) } + nodesOnline := s.nodesOnline s.Unlock() - s.updateReceiver.UpdateNodeConnection(s.nodesOnline) + s.updateReceiver.UpdateNodeConnection(nodesOnline) for _, entry := range s.treeStatusBuf { err = s.updateReceiver.UpdateTree(ctx, entry.treeId, entry.status) if err != nil {