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

Fix objectsync etc

This commit is contained in:
mcrakhman 2023-04-18 22:51:12 +02:00 committed by Mikhail Iudin
parent c64921a249
commit dc910d51c5
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
22 changed files with 320 additions and 254 deletions

View file

@ -8,6 +8,7 @@ import (
"github.com/anytypeio/any-sync/commonspace/credentialprovider"
"github.com/anytypeio/any-sync/commonspace/headsync"
"github.com/anytypeio/any-sync/commonspace/object/acl/aclrecordproto"
"github.com/anytypeio/any-sync/commonspace/object/tree/objecttree"
"github.com/anytypeio/any-sync/commonspace/object/tree/treechangeproto"
"github.com/anytypeio/any-sync/commonspace/object/treemanager"
"github.com/anytypeio/any-sync/commonspace/objectsync"
@ -152,6 +153,12 @@ func (s *spaceService) NewSpace(ctx context.Context, id string) (Space, error) {
// TODO: move it to the client package and add possibility to inject StatusProvider from the client
syncStatus = syncstatus.NewSyncStatusProvider(st.Id(), syncstatus.DefaultDeps(lastConfiguration, st))
}
var builder objecttree.BuildObjectTreeFunc
if s.config.TreeInMemoryData {
builder = objecttree.BuildEmptyDataObjectTree
} else {
builder = objecttree.BuildObjectTree
}
peerManager, err := s.peermanagerProvider.NewPeerManager(ctx, id)
if err != nil {
@ -171,6 +178,7 @@ func (s *spaceService) NewSpace(ctx context.Context, id string) (Space, error) {
peerManager: peerManager,
storage: st,
treesUsed: &atomic.Int32{},
treeBuilder: builder,
isClosed: spaceIsClosed,
isDeleted: spaceIsDeleted,
}