(source, scope string)
| 252 | } |
| 253 | |
| 254 | func (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 | |
| 279 | func remoteFragmentRefs(source, scope string, id []byte, sel *qcode.Select) []RowRef { |
| 280 | switch source { |
no outgoing calls