diff options
Diffstat (limited to 'repo.go')
-rw-r--r-- | repo.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -144,6 +144,9 @@ func (r *Repo) Restore(destination string) { if err != nil { log.Printf("Error storing file content for '%s', written %d/%d bytes: %s\n", filePath, n, file.Size, err) } + if err := f.Close(); err != nil { + log.Printf("Error closing restored file '%s': %s\n", filePath, err) + } } } @@ -276,6 +279,9 @@ func (r *Repo) LoadChunkContent(id *ChunkId) *bytes.Reader { if err != nil { log.Panicf("Could not read from chunk '%s': %s\n", path, err) } + if err = f.Close(); err != nil { + log.Printf("Could not close chunk '%s': %s\n", path, err) + } r.chunkCache.Set(id, value) } return bytes.NewReader(value) |