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

Method remoteFragmentCacheOptions

core/cache_fragment.go:254–277  ·  view source on GitHub ↗
(source, scope string)

Source from the content-addressed store, hash-verified

252}
253
254func (s *gstate) remoteFragmentCacheOptions(source, scope string) CacheEntryOptions {
255 if source != "filesystem" || s.gj == nil || s.gj.conf == nil {
256 return CacheEntryOptions{}
257 }
258 for i := range s.gj.conf.Filesystems {
259 fc := s.gj.conf.Filesystems[i]
260 if fc.Name != scope {
261 continue
262 }
263 if fc.PublicBaseURL != "" || (fc.Backend != "s3" && fc.Backend != "gcs") {
264 return CacheEntryOptions{}
265 }
266 ttl := fc.PresignTTL
267 if ttl == 0 {
268 ttl = defaultFilesystemPresignTTL
269 }
270 hardTTL := ttl - filesystemPresignSafetySlack
271 if hardTTL <= 0 {
272 return CacheEntryOptions{NoStore: true}
273 }
274 return CacheEntryOptions{HardTTL: hardTTL}
275 }
276 return CacheEntryOptions{}
277}
278
279func remoteFragmentRefs(source, scope string, id []byte, sel *qcode.Select) []RowRef {
280 switch source {

Callers 2

resolveRemotesMethod · 0.95

Calls

no outgoing calls

Tested by 1