Merge pull request #3522 from greatroar/dump-lru

Use LRU cache in restic dump
This commit is contained in:
MichaelEischer
2021-09-24 20:33:58 +02:00
committed by GitHub
10 changed files with 141 additions and 92 deletions
+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 {