MCPcopy
hub / github.com/dosco/graphjin / processRefreshResult

Method processRefreshResult

core/gstate.go:1205–1217  ·  view source on GitHub ↗

processRefreshResult applies the same cacheability gates as tryCacheSet (offset pagination, response size) and returns the cleaned payload.

()

Source from the content-addressed store, hash-verified

1203// processRefreshResult applies the same cacheability gates as tryCacheSet
1204// (offset pagination, response size) and returns the cleaned payload.
1205func (s *gstate) processRefreshResult() ([]byte, []RowRef, error) {
1206 if len(s.data) == 0 || s.cs == nil || s.cs.st.qc == nil {
1207 return nil, nil, nil
1208 }
1209 qc := s.cs.st.qc
1210 if s.hasOffsetPagination(qc) {
1211 return nil, nil, nil
1212 }
1213 if len(s.data) > maxResponseSize {
1214 return nil, nil, nil
1215 }
1216 return NewResponseProcessor(qc).ProcessForCache(s.data)
1217}
1218
1219// tryCacheSet stores the response in cache with row-level indices.
1220func (s *gstate) tryCacheSet(c context.Context) {

Callers 1

runForRefreshMethod · 0.95

Calls 3

hasOffsetPaginationMethod · 0.95
NewResponseProcessorFunction · 0.85
ProcessForCacheMethod · 0.80

Tested by

no test coverage detected