Skip to content

Commit e41e10a

Browse files
committed
Removed GetActive function
This function is unnecessary; Get already handles expired and invalidated entry checks. Update go version to 1.23
1 parent 8ceb9ac commit e41e10a

File tree

3 files changed

+1
-16
lines changed

3 files changed

+1
-16
lines changed

cache.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ type LoadingCache interface {
6161
// to load value if it is not present.
6262
Get(Key) (Value, error)
6363

64-
GetActive(Key) (Value, error)
65-
6664
// Refresh loads new value for Key. If the Key already existed, the previous value
6765
// will continue to be returned by Get while the new value is loading.
6866
// If Key does not exist, this function will block until the value is loaded.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/Comcast/goburrow-cache
22

3-
go 1.17
3+
go 1.23

local.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package cache
22

33
import (
4-
"errors"
54
"sync"
65
"sync/atomic"
76
"time"
@@ -189,18 +188,6 @@ func (c *localCache) Get(k Key) (Value, error) {
189188
return en.getValue(), nil
190189
}
191190

192-
func (c *localCache) GetActive(k Key) (Value, error) {
193-
obj, err := c.Get(k)
194-
if err != nil {
195-
return nil, err
196-
}
197-
en := c.cache.get(k, sum(k))
198-
if en != nil && !en.getInvalidated() {
199-
return obj, nil
200-
}
201-
return nil, errors.New("entry invalidated")
202-
}
203-
204191
// GetAllKeys returns all keys.
205192
func (c *localCache) GetAllKeys() []interface{} {
206193
keys := make([]interface{}, 0, c.cache.len())

0 commit comments

Comments
 (0)