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:
parent
7178b8bdc4
commit
dfa2661dfe
3 changed files with 6 additions and 9 deletions
|
@ -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)
|
||||
|
|
|
@ -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++
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue