From 959b1307c6c0710daa97599641ca0a7c03ad1128 Mon Sep 17 00:00:00 2001 From: mcrakhman Date: Mon, 17 Jul 2023 14:48:05 +0200 Subject: [PATCH] Remove from config --- commonspace/config/config.go | 1 - commonspace/headsync/diffsyncer.go | 4 +++- commonspace/headsync/headsync.go | 2 -- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/commonspace/config/config.go b/commonspace/config/config.go index a8864fef..cce4b548 100644 --- a/commonspace/config/config.go +++ b/commonspace/config/config.go @@ -7,6 +7,5 @@ type ConfigGetter interface { type Config struct { GCTTL int `yaml:"gcTTL"` SyncPeriod int `yaml:"syncPeriod"` - SyncLogPeriod int `yaml:"syncLogPeriod"` KeepTreeDataInMemory bool `yaml:"keepTreeDataInMemory"` } diff --git a/commonspace/headsync/diffsyncer.go b/commonspace/headsync/diffsyncer.go index 2acafa92..43528c2f 100644 --- a/commonspace/headsync/diffsyncer.go +++ b/commonspace/headsync/diffsyncer.go @@ -26,6 +26,8 @@ type DiffSyncer interface { Close() error } +const logPeriodSecs = 200 + func newDiffSyncer(hs *headSync) DiffSyncer { return &diffSyncer{ diff: hs.diff, @@ -35,7 +37,7 @@ func newDiffSyncer(hs *headSync) DiffSyncer { peerManager: hs.peerManager, clientFactory: spacesyncproto.ClientFactoryFunc(spacesyncproto.NewDRPCSpaceSyncClient), credentialProvider: hs.credentialProvider, - log: newSyncLogger(hs.log, hs.syncLogPeriod), + log: newSyncLogger(hs.log, logPeriodSecs), syncStatus: hs.syncStatus, deletionState: hs.deletionState, } diff --git a/commonspace/headsync/headsync.go b/commonspace/headsync/headsync.go index b5477053..de6c51d4 100644 --- a/commonspace/headsync/headsync.go +++ b/commonspace/headsync/headsync.go @@ -48,7 +48,6 @@ type headSync struct { spaceId string spaceIsDeleted *atomic.Bool syncPeriod int - syncLogPeriod int periodicSync periodicsync.PeriodicSync storage spacestorage.SpaceStorage @@ -75,7 +74,6 @@ func (h *headSync) Init(a *app.App) (err error) { h.spaceId = shared.SpaceId h.spaceIsDeleted = shared.SpaceIsDeleted h.syncPeriod = cfg.GetSpace().SyncPeriod - h.syncLogPeriod = cfg.GetSpace().SyncLogPeriod h.configuration = a.MustComponent(nodeconf.CName).(nodeconf.NodeConf) h.log = log.With(zap.String("spaceId", h.spaceId)) h.storage = a.MustComponent(spacestorage.CName).(spacestorage.SpaceStorage)