1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-09 17:44:59 +09:00

GO-1310: Rename package status to syncstatus

This commit is contained in:
Sergey 2023-04-25 18:17:59 +02:00 committed by Mikhail Iudin
parent 5a83d7ac54
commit db5b8c6cd0
No known key found for this signature in database
GPG key ID: FAAAA8BAABDFF1C0
9 changed files with 20 additions and 20 deletions

View file

@ -46,8 +46,8 @@ import (
"github.com/anytypeio/go-anytype-middleware/core/recordsbatcher"
"github.com/anytypeio/go-anytype-middleware/core/relation"
"github.com/anytypeio/go-anytype-middleware/core/session"
"github.com/anytypeio/go-anytype-middleware/core/status"
"github.com/anytypeio/go-anytype-middleware/core/subscription"
"github.com/anytypeio/go-anytype-middleware/core/syncstatus"
"github.com/anytypeio/go-anytype-middleware/core/wallet"
"github.com/anytypeio/go-anytype-middleware/metrics"
"github.com/anytypeio/go-anytype-middleware/pkg/lib/cafe"
@ -127,13 +127,13 @@ func Bootstrap(a *app.App, components ...app.Component) {
fileSyncUpdateInterval := 5 * time.Second
fileSyncStatusRegistry := filesyncstatus.NewRegistry(fileSyncService, fileStore, syncStatusIndexer, fileSyncUpdateInterval)
linkedFilesStatusWatcher := status.NewLinkedFilesWatcher(spaceService, fileSyncStatusRegistry)
subObjectsStatusWatcher := status.NewSubObjectsWatcher()
statusUpdateReceiver := status.NewUpdateReceiver(coreService, linkedFilesStatusWatcher, subObjectsStatusWatcher, cfg, eventService.Send)
objectStatusWatcher := status.NewSpaceObjectWatcher(spaceService, statusUpdateReceiver)
linkedFilesStatusWatcher := syncstatus.NewLinkedFilesWatcher(spaceService, fileSyncStatusRegistry)
subObjectsStatusWatcher := syncstatus.NewSubObjectsWatcher()
statusUpdateReceiver := syncstatus.NewUpdateReceiver(coreService, linkedFilesStatusWatcher, subObjectsStatusWatcher, cfg, eventService.Send)
objectStatusWatcher := syncstatus.NewSpaceObjectWatcher(spaceService, statusUpdateReceiver)
fileSyncStatusWatcher := filesyncstatus.New(fileSyncStatusRegistry, statusUpdateReceiver, fileSyncUpdateInterval)
statusService := status.New(sbtProvider, spaceService, coreService, fileSyncStatusWatcher, objectStatusWatcher, subObjectsStatusWatcher, linkedFilesStatusWatcher)
syncStatusService := syncstatus.New(sbtProvider, spaceService, coreService, fileSyncStatusWatcher, objectStatusWatcher, subObjectsStatusWatcher, linkedFilesStatusWatcher)
fileService := files.New(fileSyncStatusWatcher, objectStore)
@ -178,7 +178,7 @@ func Bootstrap(a *app.App, components ...app.Component) {
Register(fileSyncStatusWatcher).
Register(indexerService).
Register(linkedFilesStatusWatcher).
Register(statusService).
Register(syncStatusService).
Register(history.New()).
Register(gateway.New()).
Register(export.New(sbtProvider)).

View file

@ -38,7 +38,7 @@ import (
"github.com/anytypeio/go-anytype-middleware/core/filestorage/filesync"
"github.com/anytypeio/go-anytype-middleware/core/relation"
"github.com/anytypeio/go-anytype-middleware/core/session"
"github.com/anytypeio/go-anytype-middleware/core/status"
"github.com/anytypeio/go-anytype-middleware/core/syncstatus"
"github.com/anytypeio/go-anytype-middleware/metrics"
"github.com/anytypeio/go-anytype-middleware/pb"
"github.com/anytypeio/go-anytype-middleware/pkg/lib/bundle"
@ -123,7 +123,7 @@ type TemplateIDGetter interface {
type Service struct {
anytype core.Service
status status.Service
syncStatus syncstatus.Service
sendEvent func(event *pb.Event)
closed bool
linkPreview linkpreview.LinkPreview
@ -155,7 +155,7 @@ func (s *Service) Name() string {
func (s *Service) Init(a *app.App) (err error) {
s.anytype = a.MustComponent(core.CName).(core.Service)
s.status = a.MustComponent(status.CName).(status.Service)
s.syncStatus = a.MustComponent(syncstatus.CName).(syncstatus.Service)
s.linkPreview = a.MustComponent(linkpreview.CName).(linkpreview.LinkPreview)
s.process = a.MustComponent(process.CName).(process.Service)
s.sendEvent = a.MustComponent(event.CName).(event.Sender).Send
@ -215,7 +215,7 @@ func (s *Service) OpenBlock(
return
}
afterShowTime := time.Now()
_, err = s.status.Watch(id, func() []string {
_, err = s.syncStatus.Watch(id, func() []string {
ob.Lock()
defer ob.Unlock()
bs := ob.NewState()
@ -224,7 +224,7 @@ func (s *Service) OpenBlock(
})
if err == nil {
ob.AddHook(func(_ smartblock.ApplyInfo) error {
s.status.Unwatch(id)
s.syncStatus.Unwatch(id)
return nil
}, smartblock.HookOnClose)
}

View file

@ -1,4 +1,4 @@
package status
package syncstatus
import (
"context"

View file

@ -1,4 +1,4 @@
package status
package syncstatus
import (
"context"

View file

@ -1,4 +1,4 @@
package status
package syncstatus
//
// import (

View file

@ -1,4 +1,4 @@
package status
package syncstatus
import (
"context"

View file

@ -1,4 +1,4 @@
package status
package syncstatus
import (
"sync"

View file

@ -1,4 +1,4 @@
package status
package syncstatus
import (
"context"

View file

@ -7,12 +7,12 @@ import (
"github.com/golang/mock/gomock"
"github.com/anytypeio/go-anytype-middleware/app/testapp"
"github.com/anytypeio/go-anytype-middleware/core/status"
"github.com/anytypeio/go-anytype-middleware/core/syncstatus"
)
func RegisterMockStatus(ctrl *gomock.Controller, ta *testapp.TestApp) *MockService {
ms := NewMockService(ctrl)
ms.EXPECT().Name().AnyTimes().Return(status.CName)
ms.EXPECT().Name().AnyTimes().Return(syncstatus.CName)
ms.EXPECT().Init(gomock.Any()).AnyTimes()
ms.EXPECT().Run(context.Background()).AnyTimes()
ms.EXPECT().Close(context.Background()).AnyTimes()