forked from TrueCloudLab/restic
local backend: Drop file content from cache after write
This commit is contained in:
parent
5b5bb070b9
commit
b7713d2d34
1 changed files with 6 additions and 0 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
|
||||
"restic/backend"
|
||||
"restic/debug"
|
||||
"restic/fs"
|
||||
)
|
||||
|
||||
// Local is a backend in a local directory.
|
||||
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue