1
0
Fork 0
mirror of https://github.com/anyproto/anytype-heart.git synced 2025-06-10 01:51:07 +09:00

GO-1310: Address code review

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

View file

@ -121,8 +121,7 @@ func Bootstrap(a *app.App, components ...app.Component) {
fileSyncService := filesync.New()
fileStore := filestore.New()
fileSyncUpdateInterval := 5 * time.Second
const fileWatcherUpdateInterval = 5 * time.Second
syncStatusService := syncstatus.New(
sbtProvider,
spaceService,
@ -132,7 +131,7 @@ func Bootstrap(a *app.App, components ...app.Component) {
blockService,
cfg,
eventService.Send,
fileSyncUpdateInterval,
fileWatcherUpdateInterval,
)
fileService := files.New(syncStatusService)

View file

@ -83,9 +83,7 @@ func (w *linkedFilesWatcher) updateLinkedFilesSummary(parentObjectID string, fil
}
switch status {
case syncstatus.StatusUnknown:
summary.Pinning++
case syncstatus.StatusNotSynced:
case syncstatus.StatusUnknown, syncstatus.StatusNotSynced:
summary.Pinning++
case syncstatus.StatusSynced:
summary.Pinned++

View file

@ -57,13 +57,13 @@ func New(
picker getblock.Picker,
cfg *config.Config,
sendEvent func(event *pb.Event),
updateInterval time.Duration,
fileWatcherUpdateInterval time.Duration,
) Service {
fileStatusRegistry := newFileStatusRegistry(fileSyncService, fileStore, picker, updateInterval)
fileStatusRegistry := newFileStatusRegistry(fileSyncService, fileStore, picker, fileWatcherUpdateInterval)
linkedFilesWatcher := newLinkedFilesWatcher(spaceService, fileStatusRegistry)
subObjectsWatcher := newSubObjectsWatcher()
updateReceiver := newUpdateReceiver(coreService, linkedFilesWatcher, subObjectsWatcher, cfg, sendEvent)
fileWatcher := newFileWatcher(fileStatusRegistry, updateReceiver, updateInterval)
fileWatcher := newFileWatcher(fileStatusRegistry, updateReceiver, fileWatcherUpdateInterval)
objectWatcher := newObjectWatcher(spaceService, updateReceiver)
return &service{
spaceService: spaceService,