1
0
mirror of https://github.com/libp2p/go-libp2p-peerstore.git synced 2025-03-30 13:50:07 +08:00

change default purge interval to 2 hours.

This commit is contained in:
Raúl Kripalani 2019-02-06 14:43:10 +00:00
parent e16cac9f5e
commit 25e4df45aa

View File

@ -31,16 +31,16 @@ type Options struct {
GCInitialDelay time.Duration
}
// DefaultOpts returns the default options for a persistent peerstore:
// DefaultOpts returns the default options for a persistent peerstore, with the full-purge GC algorithm:
//
// * Cache size: 1024.
// * GC purge interval: 10 minutes.
// * GC purge interval: 2 hours.
// * GC lookahead interval: disabled.
// * GC initial delay: 60 seconds.
func DefaultOpts() Options {
return Options{
CacheSize: 1024,
GCPurgeInterval: 10 * time.Minute,
GCPurgeInterval: 2 * time.Hour,
GCLookaheadInterval: 0,
GCInitialDelay: 60 * time.Second,
}