MCPcopy Create free account
hub / github.com/cloudwan/gohan / getCached

Method getCached

db/sql/cached_transaction.go:124–136  ·  view source on GitHub ↗
(schemeID string, sc *selectContext)

Source from the content-addressed store, hash-verified

122}
123
124func (tx *CachedTransaction) getCached(schemeID string, sc *selectContext) (list []*schema.Resource, total uint64, wasCached bool, wasLocked bool, err error) {
125 key, err := tx.createKey(schemeID, sc)
126 if err != nil {
127 return nil, 0, false, false, err
128 }
129
130 res, present := tx.QueryCache[key]
131 if present {
132 return res.list, res.total, true, res.isLocked, nil
133 } else {
134 return nil, 0, false, false, nil
135 }
136}
137
138func (tx *CachedTransaction) saveCache(schemeID string, sc *selectContext, list []*schema.Resource, total uint64, wasLocked bool, errList error) error {
139 if errList != nil {

Callers 2

ListContextMethod · 0.95
LockListContextMethod · 0.95

Calls 1

createKeyMethod · 0.95

Tested by

no test coverage detected