sync of changes
This commit is contained in:
14
pkg/cache/directory.go
vendored
14
pkg/cache/directory.go
vendored
@@ -14,8 +14,7 @@ import (
|
||||
type Directory struct {
|
||||
BaseFolder string
|
||||
MaxLife time.Duration
|
||||
|
||||
lock sync.Mutex
|
||||
lock sync.Mutex
|
||||
}
|
||||
|
||||
var _ Cache = &Directory{}
|
||||
@@ -76,7 +75,16 @@ func (d *Directory) AutoCleanupRoutine(ctx context.Context) error {
|
||||
func (d *Directory) openFile(key string) (*os.File, error) {
|
||||
path := d.GetPath(key)
|
||||
|
||||
return os.Open(path)
|
||||
res, err := os.Open(path)
|
||||
|
||||
if err != nil {
|
||||
if os.IsNotExist(err) {
|
||||
return nil, ErrNotFound
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return res, nil
|
||||
}
|
||||
|
||||
func (d *Directory) Set(key string, value io.Reader) error {
|
||||
|
Reference in New Issue
Block a user