aboutsummaryrefslogtreecommitdiff
path: root/repo.go
diff options
context:
space:
mode:
Diffstat (limited to 'repo.go')
-rw-r--r--repo.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/repo.go b/repo.go
index 07eb5ea..50eeb25 100644
--- a/repo.go
+++ b/repo.go
@@ -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)