MCPcopy Create free account
hub / github.com/devfeel/dotweb / Exists

Method Exists

cache/runtime/cache_runtime.go:203–209  ·  view source on GitHub ↗

Exist check item exist in runtime cache.

(key string)

Source from the content-addressed store, hash-verified

201
202// Exist check item exist in runtime cache.
203func (ca *RuntimeCache) Exists(key string) (bool, error) {
204 if itemObj, ok := ca.items.Load(key); ok {
205 item := itemObj.(*RuntimeItem)
206 return !item.isExpire(), nil
207 }
208 return false, nil
209}
210
211// Delete item in runtime cacha.
212// if not exists, we think it's success

Callers 2

TestRuntimeCache_GetFunction · 0.95

Calls 1

isExpireMethod · 0.80

Tested by 2

TestRuntimeCache_GetFunction · 0.76