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

Add noopindexer

This commit is contained in:
Mikhail Rakhmanov 2025-04-07 15:44:41 +02:00
parent 38d822ec48
commit 4054a914a7
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B

View file

@ -14,6 +14,7 @@ import (
"github.com/anyproto/any-sync/commonspace/acl/aclclient"
"github.com/anyproto/any-sync/commonspace/deletionmanager"
"github.com/anyproto/any-sync/commonspace/object/keyvalue"
"github.com/anyproto/any-sync/commonspace/object/keyvalue/keyvaluestorage"
"github.com/anyproto/any-sync/commonspace/object/treesyncer"
"github.com/anyproto/any-sync/commonspace/sync"
"github.com/anyproto/any-sync/commonspace/sync/objectsync"
@ -70,6 +71,7 @@ type Deps struct {
SyncStatus syncstatus.StatusUpdater
TreeSyncer treesyncer.TreeSyncer
AccountService accountservice.Service
Indexer keyvaluestorage.Indexer
}
type spaceService struct {
@ -181,10 +183,15 @@ func (s *spaceService) NewSpace(ctx context.Context, id string, deps Deps) (Spac
if deps.AccountService != nil {
spaceApp.Register(deps.AccountService)
}
var keyValueIndexer keyvaluestorage.Indexer = keyvaluestorage.NoOpIndexer{}
if deps.Indexer != nil {
keyValueIndexer = deps.Indexer
}
spaceApp.Register(state).
Register(deps.SyncStatus).
Register(peerManager).
Register(st).
Register(keyValueIndexer).
Register(keyvalue.New()).
Register(objectsync.New()).
Register(sync.NewSyncService()).