Skip to content

Commit

Permalink
local backend: Drop file content from cache after write
Browse files Browse the repository at this point in the history
  • Loading branch information
fd0 committed Mar 28, 2016
1 parent 5b5bb07 commit b7713d2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/restic/backend/local/local.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

"restic/backend"
"restic/debug"
"restic/fs"
)

// Local is a backend in a local directory.
Expand Down Expand Up @@ -146,6 +147,11 @@ func writeToTempfile(tempdir string, p []byte) (filename string, err error) {
return "", err
}

err = fs.ClearCache(tmpfile)
if err != nil {
return "", err
}

err = tmpfile.Close()
if err != nil {
return "", err
Expand Down

0 comments on commit b7713d2

Please sign in to comment.