Skip to content

Commit

Permalink
feat: increase the max record age to 48h (PUT_VALUE, RFM17) (#794)
Browse files Browse the repository at this point in the history
* increase the max record age for the PUT_VALUE method based on RFM17
* refactor: reuse providers.ProvideValidity

Co-authored-by: Marcin Rataj <lidel@lidel.org>
  • Loading branch information
cortze and lidel authored Dec 11, 2022
1 parent 5999afb commit c8b17c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion providers/providers_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c8b17c2

Please sign in to comment.