mirror of
https://github.com/restic/restic.git
synced 2024-12-25 09:18:55 +00:00
restic: add comment about StreamTrees shutdown
This commit is contained in:
parent
1e306be000
commit
68608a89ad
1 changed files with 3 additions and 1 deletions
|
@ -147,7 +147,9 @@ func filterTrees(ctx context.Context, trees IDs, loaderChan chan<- trackedID,
|
|||
}
|
||||
|
||||
// StreamTrees iteratively loads the given trees and their subtrees. The skip method
|
||||
// is guaranteed to always be called from the same goroutine.
|
||||
// is guaranteed to always be called from the same goroutine. To shutdown the started
|
||||
// goroutines, either read all items from the channel or cancel the context. Then `Wait()`
|
||||
// on the errgroup until all goroutines were stopped.
|
||||
func StreamTrees(ctx context.Context, wg *errgroup.Group, repo TreeLoader, trees IDs, skip func(tree ID) bool, p *progress.Counter) <-chan TreeItem {
|
||||
loaderChan := make(chan trackedID)
|
||||
loadedTreeChan := make(chan trackedTreeItem)
|
||||
|
|
Loading…
Reference in a new issue