From c3c24b227ab0ff7e688455b8342d38f47f80bcb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Kripalani?= Date: Wed, 28 Nov 2018 01:29:09 +0000 Subject: [PATCH] rename GCPruneInterval to GCPurgeInterval for consistency. --- pstoreds/addr_book.go | 2 +- pstoreds/ds_gc_test.go | 4 ++-- pstoreds/ds_test.go | 4 ++-- pstoreds/peerstore.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pstoreds/addr_book.go b/pstoreds/addr_book.go index c57e3ed..4db3d64 100644 --- a/pstoreds/addr_book.go +++ b/pstoreds/addr_book.go @@ -272,7 +272,7 @@ func (ab *dsAddrBook) background() { go func() { select { case <-time.After(ab.opts.GCInitialDelay): - pruneTimer = time.NewTicker(ab.opts.GCPruneInterval) + pruneTimer = time.NewTicker(ab.opts.GCPurgeInterval) lookaheadTimer = time.NewTicker(ab.opts.GCLookaheadInterval) } }() diff --git a/pstoreds/ds_gc_test.go b/pstoreds/ds_gc_test.go index f3e5ea6..6de9539 100644 --- a/pstoreds/ds_gc_test.go +++ b/pstoreds/ds_gc_test.go @@ -40,7 +40,7 @@ func TestGCLookahead(t *testing.T) { // effectively disable automatic GC for this test. opts.GCInitialDelay = 90 * time.Hour opts.GCLookaheadInterval = 10 * time.Second - opts.GCPruneInterval = 1 * time.Minute + opts.GCPurgeInterval = 1 * time.Minute factory := addressBookFactory(t, badgerStore, opts) ab, closeFn := factory() @@ -85,7 +85,7 @@ func TestGCPurging(t *testing.T) { // effectively disable automatic GC for this test. opts.GCInitialDelay = 90 * time.Hour opts.GCLookaheadInterval = 20 * time.Second - opts.GCPruneInterval = 1 * time.Minute + opts.GCPurgeInterval = 1 * time.Minute factory := addressBookFactory(t, badgerStore, opts) ab, closeFn := factory() diff --git a/pstoreds/ds_test.go b/pstoreds/ds_test.go index 48e6e7f..abb712b 100644 --- a/pstoreds/ds_test.go +++ b/pstoreds/ds_test.go @@ -37,7 +37,7 @@ func TestDsAddrBook(t *testing.T) { t.Parallel() opts := DefaultOpts() - opts.GCPruneInterval = 1 * time.Second + opts.GCPurgeInterval = 1 * time.Second opts.CacheSize = 1024 pt.TestAddrBook(t, addressBookFactory(t, dsFactory, opts)) @@ -47,7 +47,7 @@ func TestDsAddrBook(t *testing.T) { t.Parallel() opts := DefaultOpts() - opts.GCPruneInterval = 1 * time.Second + opts.GCPurgeInterval = 1 * time.Second opts.CacheSize = 0 pt.TestAddrBook(t, addressBookFactory(t, dsFactory, opts)) diff --git a/pstoreds/peerstore.go b/pstoreds/peerstore.go index ba01ad1..a189f66 100644 --- a/pstoreds/peerstore.go +++ b/pstoreds/peerstore.go @@ -19,7 +19,7 @@ type Options struct { CacheSize uint // Sweep interval to purge expired addresses from the datastore. - GCPruneInterval time.Duration + GCPurgeInterval time.Duration // Interval to renew the GC lookahead window. GCLookaheadInterval time.Duration @@ -36,7 +36,7 @@ type Options struct { func DefaultOpts() Options { return Options{ CacheSize: 1024, - GCPruneInterval: 5 * time.Minute, + GCPurgeInterval: 5 * time.Minute, GCLookaheadInterval: 12 * time.Hour, GCInitialDelay: 60 * time.Second, }