Merge pull request #3522 from greatroar/dump-lru

Use LRU cache in restic dump
This commit is contained in:
MichaelEischer authored and GitHub committed 2021-09-24 20:33:58 +02:00
commit a5e103a212
10 files changed
+141 -92

No files matched your search

+2 -1
View File
@@ -95,7 +95,8 @@ func printFromTree(ctx context.Context, tree *restic.Tree, repo restic.Repositor
if node.Name == pathComponents[0] {
switch {
case l == 1 && dump.IsFile(node):
return dump.GetNodeData(ctx, os.Stdout, repo, node)
cache := dump.NewCache()
return dump.WriteNodeData(ctx, os.Stdout, repo, node, cache)
case l > 1 && dump.IsDir(node):
subtree, err := repo.LoadTree(ctx, *node.Subtree)
if err != nil {