mirror of
https://github.com/restic/restic.git
synced 2025-03-16 00:00:05 +01:00
Update files in the cache on save
This commit is contained in:
parent
16715ed86f
commit
10fb5c8f3f
1 changed files with 11 additions and 1 deletions
|
@ -322,7 +322,17 @@ func (r *Repository) SaveUnpacked(t restic.FileType, p []byte) (id restic.ID, er
|
|||
return restic.ID{}, err
|
||||
}
|
||||
|
||||
debug.Log("Repo.SaveJSONUnpacked", "blob %v saved", h)
|
||||
// store file in the cache
|
||||
if r.cache != nil && (t == restic.IndexFile || t == restic.SnapshotFile) {
|
||||
h := restic.Handle{Name: id.String(), Type: t}
|
||||
err := r.cache.PutFile(h, p)
|
||||
if err != nil {
|
||||
return restic.ID{}, err
|
||||
}
|
||||
debug.Log("Repo.Save", "updated file %v in cache", h)
|
||||
}
|
||||
|
||||
debug.Log("Repo.SaveJSONUnpacked", "file %v saved", h)
|
||||
return id, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue