Skip to content

Commit

Permalink
fix export shard cache
Browse files Browse the repository at this point in the history
  • Loading branch information
mars79668 committed Nov 5, 2019
1 parent 05a1d78 commit d9412c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sharded.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import (
//
// See cache_test.go for a few benchmarks.

// ShardedCache shard cache
type ShardedCache struct {
*shardedCache
}
Expand Down Expand Up @@ -141,7 +142,7 @@ func (j *shardedJanitor) Run(sc *shardedCache) {
}
}

func stopShardedJanitor(sc *unexportedShardedCache) {
func stopShardedJanitor(sc *ShardedCache) {
sc.janitor.stop <- true
}

Expand Down Expand Up @@ -178,7 +179,8 @@ func newShardedCache(n int, de time.Duration) *shardedCache {
return sc
}

func NewSharded(defaultExpiration, cleanupInterval time.Duration, shards int) *unexportedShardedCache {
// NewSharded create new shard cache
func NewSharded(defaultExpiration, cleanupInterval time.Duration, shards int) *ShardedCache {
if defaultExpiration == 0 {
defaultExpiration = -1
}
Expand Down

0 comments on commit d9412c6

Please sign in to comment.