Document creation fixes

This commit is contained in:
mcrakhman 2022-10-19 17:59:12 +02:00 committed by Mikhail Iudin
parent 071d0800b7
commit 282ef17df3
No known key found for this signature in database
GPG Key ID: FAAAA8BAABDFF1C0
4 changed files with 21 additions and 3 deletions

View File

@ -37,7 +37,7 @@ func newListStorage(spaceId string, db *badger.DB, txn *badger.Txn) (ls storage.
ls = &listStorage{ ls = &listStorage{
db: db, db: db,
keys: aclKeys{}, keys: newACLKeys(spaceId),
id: stringId, id: stringId,
root: rootWithId, root: rootWithId,
} }
@ -70,7 +70,7 @@ func createListStorage(spaceId string, db *badger.DB, txn *badger.Txn, root *acl
ls = &listStorage{ ls = &listStorage{
db: db, db: db,
keys: aclKeys{}, keys: newACLKeys(spaceId),
id: root.Id, id: root.Id,
root: root, root: root,
} }

View File

@ -125,5 +125,5 @@ func (s *spaceStorage) StoredIds() (ids []string, err error) {
} }
func (s *spaceStorage) Close() (err error) { func (s *spaceStorage) Close() (err error) {
return s.objDb.Close() return nil
} }

View File

@ -1,6 +1,7 @@
package storage package storage
import ( import (
"context"
"github.com/anytypeio/go-anytype-infrastructure-experiments/client/badgerprovider" "github.com/anytypeio/go-anytype-infrastructure-experiments/client/badgerprovider"
"github.com/anytypeio/go-anytype-infrastructure-experiments/common/app" "github.com/anytypeio/go-anytype-infrastructure-experiments/common/app"
"github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/storage" "github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/storage"
@ -14,6 +15,7 @@ type storageService struct {
type ClientStorage interface { type ClientStorage interface {
storage.SpaceStorageProvider storage.SpaceStorageProvider
app.ComponentRunnable
AllSpaceIds() (ids []string, err error) AllSpaceIds() (ids []string, err error)
} }
@ -62,3 +64,11 @@ func (s *storageService) AllSpaceIds() (ids []string, err error) {
}) })
return return
} }
func (s *storageService) Run(ctx context.Context) (err error) {
return nil
}
func (s *storageService) Close(ctx context.Context) (err error) {
return s.db.Close()
}

View File

@ -89,6 +89,14 @@ func (s *space) Init(ctx context.Context) (err error) {
if err != nil { if err != nil {
return return
} }
aclStorage, err := s.storage.ACLStorage()
if err != nil {
return
}
s.aclList, err = list.BuildACLList(aclStorage)
if err != nil {
return
}
s.diffService.Init(initialIds) s.diffService.Init(initialIds)
s.syncService.Init() s.syncService.Init()
return nil return nil