func NewCache(size int) (*Cache, error) {
	c, err := lru.NewWithEvict(size, func(key interface{}, value interface{}) {
		go func() {
			tree, ok := value.(*dbHashTree)
			if !ok {
				logrus.Infof("non hashtree slice value of type: %v", reflect.TypeOf(value))
				return
			}
			if err := tree.Destroy(); err != nil {
				logrus.Infof("failed to destroy hashtree: %v", err)
			}
		}()
	})
	if err != nil {
		return nil, err
	}
	return &Cache{c}, nil
}
func NewCache(size int) (*Cache, error) {
	c, err := lru.NewWithEvict(size, func(key interface{}, value interface{}) {
		go func() {
			tree, ok := value.(*dbHashTree)
			if !ok {
				logrus.Infof("non hashtree slice value of type: %v", reflect.TypeOf(value))
				return
			}
			if err := tree.Destroy(); err != nil {
				logrus.Infof("failed to destroy hashtree: %v", err)
			}
		}()
	})
	if err != nil {
		return nil, err
	}
	return &Cache{c}, nil
}
func NewCache ( size int ) ( * Cache , error ) { c , err := lru . NewWithEvict ( size , func ( key interface { } , value interface { } ) { go func ( ) { tree , ok := value . ( * dbHashTree ) if ! ok { logrus . Infof ( " " , reflect . TypeOf ( value ) ) return } if err := tree . Destroy ( ) ; err != nil { logrus . Infof ( " " , err ) } } ( ) } ) if err != nil { return nil , err } return & Cache { c } , nil }
// NewCache creates a new cache.
NewCache creates a new cache .