@@ -81,7 +81,7 @@ func (c *Cache) fileName(id [HashSize]byte, key string) string {
81
81
var errMissing = errors .New ("cache entry not found" )
82
82
83
83
func IsErrMissing (err error ) bool {
84
- return err == errMissing
84
+ return errors . Cause ( err ) == errMissing
85
85
}
86
86
87
87
const (
@@ -199,26 +199,6 @@ func (c *Cache) get(id ActionID) (Entry, error) {
199
199
return Entry {buf , size , time .Unix (0 , tm )}, nil
200
200
}
201
201
202
- // GetFile looks up the action ID in the cache and returns
203
- // the name of the corresponding data file.
204
- func (c * Cache ) GetFile (id ActionID ) (file string , entry Entry , err error ) {
205
- entry , err = c .Get (id )
206
- if err != nil {
207
- return "" , Entry {}, err
208
- }
209
-
210
- file , err = c .OutputFile (entry .OutputID )
211
- if err != nil {
212
- return "" , Entry {}, err
213
- }
214
-
215
- info , err := os .Stat (file )
216
- if err != nil || info .Size () != entry .Size {
217
- return "" , Entry {}, errMissing
218
- }
219
- return file , entry , nil
220
- }
221
-
222
202
// GetBytes looks up the action ID in the cache and returns
223
203
// the corresponding output bytes.
224
204
// GetBytes should only be used for data that can be expected to fit in memory.
@@ -282,6 +262,9 @@ const (
282
262
func (c * Cache ) used (file string ) error {
283
263
info , err := os .Stat (file )
284
264
if err != nil {
265
+ if os .IsNotExist (err ) {
266
+ return errMissing
267
+ }
285
268
return errors .Wrapf (err , "failed to stat file %s" , file )
286
269
}
287
270
0 commit comments