From c8b17c2e18f1083dea7742a4f5abb314d9f61ded Mon Sep 17 00:00:00 2001 From: Mikel Cortes <45786396+cortze@users.noreply.github.com> Date: Sun, 11 Dec 2022 21:08:55 +0100 Subject: [PATCH] feat: increase the max record age to 48h (PUT_VALUE, RFM17) (#794) * increase the max record age for the PUT_VALUE method based on RFM17 * refactor: reuse providers.ProvideValidity Co-authored-by: Marcin Rataj --- internal/config/config.go | 2 +- providers/providers_manager.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 9d9ae0ba1..7a1d14fca 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -114,7 +114,7 @@ var Defaults = func(o *Config) error { o.RoutingTable.RefreshInterval = 10 * time.Minute o.RoutingTable.AutoRefresh = true o.RoutingTable.PeerFilter = EmptyRTFilter - o.MaxRecordAge = time.Hour * 36 + o.MaxRecordAge = providers.ProvideValidity o.BucketSize = defaultBucketSize o.Concurrency = 10 diff --git a/providers/providers_manager.go b/providers/providers_manager.go index a5d0bddaa..a8099a424 100644 --- a/providers/providers_manager.go +++ b/providers/providers_manager.go @@ -30,7 +30,8 @@ const ProvidersKeyPrefix = "/providers/" // the records we return will require an extra lookup. const ProviderAddrTTL = time.Minute * 30 -// ProvideValidity is the default time that a provider record should last +// ProvideValidity is the default time that a Provider Record should last on DHT +// This value is also known as Provider Record Expiration Interval. var ProvideValidity = time.Hour * 48 var defaultCleanupInterval = time.Hour var lruCacheSize = 256