refactor: remove usless options (#5671)
refactor: remove useless options
This commit is contained in:
8
pkg/simple/client/cache/cache.go
vendored
8
pkg/simple/client/cache/cache.go
vendored
@@ -39,13 +39,13 @@ type Interface interface {
|
||||
// Set sets the value and living duration of the given key, zero duration means never expire
|
||||
Set(key string, value string, duration time.Duration) error
|
||||
|
||||
// Del deletes the given key, no error returned if the key doesn't exists
|
||||
// Del deletes the given key, no error returned if the key doesn't exist
|
||||
Del(keys ...string) error
|
||||
|
||||
// Exists checks the existence of a give key
|
||||
Exists(keys ...string) (bool, error)
|
||||
|
||||
// Expires updates object's expiration time, return err if key doesn't exist
|
||||
// Expire updates object's expiration time, return err if key doesn't exist
|
||||
Expire(key string, duration time.Duration) error
|
||||
}
|
||||
|
||||
@@ -60,6 +60,10 @@ func New(option *Options, stopCh <-chan struct{}) (Interface, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if option.Type == TypeInMemoryCache {
|
||||
klog.Warning("In-memory cache will be used, this may cause data inconsistencies when running with multiple replicas.")
|
||||
}
|
||||
|
||||
cache, err := cacheFactories[option.Type].Create(option.Options, stopCh)
|
||||
if err != nil {
|
||||
klog.Errorf("failed to create cache, error: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user