From b7713d2d34e0f5b625717bdc1ddd4ddd58f77846 Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Mon, 28 Mar 2016 15:24:18 +0200 Subject: [PATCH] local backend: Drop file content from cache after write --- src/restic/backend/local/local.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/restic/backend/local/local.go b/src/restic/backend/local/local.go index c0f33d036..42d898dd0 100644 --- a/src/restic/backend/local/local.go +++ b/src/restic/backend/local/local.go @@ -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