1
0
Fork 0
mirror of https://github.com/anyproto/any-sync.git synced 2025-06-08 05:57:03 +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 { type Config struct {
GCTTL int `yaml:"gcTTL"` GCTTL int `yaml:"gcTTL"`
SyncPeriod int `yaml:"syncPeriod"` SyncPeriod int `yaml:"syncPeriod"`
SyncLogPeriod int `yaml:"syncLogPeriod"`
KeepTreeDataInMemory bool `yaml:"keepTreeDataInMemory"` KeepTreeDataInMemory bool `yaml:"keepTreeDataInMemory"`
} }

View file

@ -26,6 +26,8 @@ type DiffSyncer interface {
Close() error Close() error
} }
const logPeriodSecs = 200
func newDiffSyncer(hs *headSync) DiffSyncer { func newDiffSyncer(hs *headSync) DiffSyncer {
return &diffSyncer{ return &diffSyncer{
diff: hs.diff, diff: hs.diff,
@ -35,7 +37,7 @@ func newDiffSyncer(hs *headSync) DiffSyncer {
peerManager: hs.peerManager, peerManager: hs.peerManager,
clientFactory: spacesyncproto.ClientFactoryFunc(spacesyncproto.NewDRPCSpaceSyncClient), clientFactory: spacesyncproto.ClientFactoryFunc(spacesyncproto.NewDRPCSpaceSyncClient),
credentialProvider: hs.credentialProvider, credentialProvider: hs.credentialProvider,
log: newSyncLogger(hs.log, hs.syncLogPeriod), log: newSyncLogger(hs.log, logPeriodSecs),
syncStatus: hs.syncStatus, syncStatus: hs.syncStatus,
deletionState: hs.deletionState, deletionState: hs.deletionState,
} }

View file

@ -48,7 +48,6 @@ type headSync struct {
spaceId string spaceId string
spaceIsDeleted *atomic.Bool spaceIsDeleted *atomic.Bool
syncPeriod int syncPeriod int
syncLogPeriod int
periodicSync periodicsync.PeriodicSync periodicSync periodicsync.PeriodicSync
storage spacestorage.SpaceStorage storage spacestorage.SpaceStorage
@ -75,7 +74,6 @@ func (h *headSync) Init(a *app.App) (err error) {
h.spaceId = shared.SpaceId h.spaceId = shared.SpaceId
h.spaceIsDeleted = shared.SpaceIsDeleted h.spaceIsDeleted = shared.SpaceIsDeleted
h.syncPeriod = cfg.GetSpace().SyncPeriod h.syncPeriod = cfg.GetSpace().SyncPeriod
h.syncLogPeriod = cfg.GetSpace().SyncLogPeriod
h.configuration = a.MustComponent(nodeconf.CName).(nodeconf.NodeConf) h.configuration = a.MustComponent(nodeconf.CName).(nodeconf.NodeConf)
h.log = log.With(zap.String("spaceId", h.spaceId)) h.log = log.With(zap.String("spaceId", h.spaceId))
h.storage = a.MustComponent(spacestorage.CName).(spacestorage.SpaceStorage) h.storage = a.MustComponent(spacestorage.CName).(spacestorage.SpaceStorage)