1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-07 21:47:02 +09:00

Remove from config

This commit is contained in:
mcrakhman 2023-07-17 14:48:05 +02:00
parent a35d94a20a
commit 959b1307c6
No known key found for this signature in database
GPG key ID: DED12CFEF5B8396B
3 changed files with 3 additions and 4 deletions

View file

@ -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"`
}

View file

@ -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,
}

View file

@ -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)