(ctx context.Context)
| 131 | } |
| 132 | |
| 133 | func (fr *FileReader) loadAllChunksSync(ctx context.Context) { |
| 134 | gate := syncutil.NewGate(20) // num readahead chunk loads at a time |
| 135 | fr.ForeachChunk(ctx, func(_ []blob.Ref, p BytesPart) error { |
| 136 | if !p.BlobRef.Valid() { |
| 137 | return nil |
| 138 | } |
| 139 | gate.Start() |
| 140 | go func(br blob.Ref) { |
| 141 | defer gate.Done() |
| 142 | rc, _, err := fr.fetcher.Fetch(ctx, br) |
| 143 | if err == nil { |
| 144 | defer rc.Close() |
| 145 | var b [1]byte |
| 146 | rc.Read(b[:]) // fault in the blob |
| 147 | } |
| 148 | }(p.BlobRef) |
| 149 | return nil |
| 150 | }) |
| 151 | } |
| 152 | |
| 153 | // UnixMtime returns the file schema's UnixMtime field, or the zero value. |
| 154 | func (fr *FileReader) UnixMtime() time.Time { |
no test coverage detected