rename GCPruneInterval to GCPurgeInterval for consistency.

This commit is contained in:
Raúl Kripalani 2018-11-28 01:29:09 +00:00
parent bbff6b7522
commit c3c24b227a
4 changed files with 7 additions and 7 deletions

View File

@ -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)
}
}()

View File

@ -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()

View File

@ -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))

View File

@ -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,
}