Ensure cache dir is always available in RunLogCache
This commit is contained in:
parent
103586a94c
commit
c2aee1e402
1 changed files with 4 additions and 0 deletions
|
|
@ -46,6 +46,10 @@ func (c RunLogCache) Exists(key string) (bool, error) {
|
|||
}
|
||||
|
||||
func (c RunLogCache) Create(key string, content io.Reader) error {
|
||||
if err := os.MkdirAll(filepath.Dir(c.cacheDir), 0755); err != nil {
|
||||
return fmt.Errorf("creating cache directory: %v", err)
|
||||
}
|
||||
|
||||
out, err := os.Create(c.filepath(key))
|
||||
if err != nil {
|
||||
return fmt.Errorf("creating cache entry: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue