WIP refactoring syncstatus headsync

This commit is contained in:
mcrakhman committed 2022-12-25 15:08:26 +01:00
1 parent 874d5bbca0
commit 3c30f72cd5
32 files changed
+390 -286

No files matched your search

+3 -3
View File
@@ -2,15 +2,15 @@ package clientspace
import (
"context"
"github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/statusservice"
"github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/syncstatus"
"go.uber.org/zap"
)
type statusReceiver struct {
}
func (s *statusReceiver) UpdateTree(ctx context.Context, treeId string, status statusservice.SyncStatus) (err error) {
log.With(zap.String("treeId", treeId), zap.Bool("synced", status == statusservice.SyncStatusSynced)).
func (s *statusReceiver) UpdateTree(ctx context.Context, treeId string, status syncstatus.SyncStatus) (err error) {
log.With(zap.String("treeId", treeId), zap.Bool("synced", status == syncstatus.SyncStatusSynced)).
Debug("updating sync status")
return nil
}
+2 -3
View File
@@ -8,7 +8,6 @@ import (
"github.com/anytypeio/go-anytype-infrastructure-experiments/common/account"
"github.com/anytypeio/go-anytype-infrastructure-experiments/common/app"
"github.com/anytypeio/go-anytype-infrastructure-experiments/common/app/logger"
"github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/diffservice"
"github.com/anytypeio/go-anytype-infrastructure-experiments/common/commonspace/treegetter"
)
@@ -17,7 +16,7 @@ type Service interface {
CreateDocument(spaceId string) (id string, err error)
DeleteDocument(spaceId, documentId string) (err error)
AllDocumentIds(spaceId string) (ids []string, err error)
AllDocumentHeads(spaceId string) (ids []diffservice.TreeHeads, err error)
AllDocumentHeads(spaceId string) (ids []headsync.TreeHeads, err error)
AddText(spaceId, documentId, text string, isSnapshot bool) (root, head string, err error)
DumpDocumentTree(spaceId, documentId string) (dump string, err error)
TreeParams(spaceId, documentId string) (root string, head []string, err error)
@@ -74,7 +73,7 @@ func (s *service) AllDocumentIds(spaceId string) (ids []string, err error) {
return
}
func (s *service) AllDocumentHeads(spaceId string) (ids []diffservice.TreeHeads, err error) {
func (s *service) AllDocumentHeads(spaceId string) (ids []headsync.TreeHeads, err error) {
space, err := s.spaceService.GetSpace(context.Background(), spaceId)
if err != nil {
return