forked from TrueCloudLab/restic
cache: Synchronize downloading
This commit adds code to synchronize downloading files to the cache. Before, requests that came in for files currently downloading would fail because the file was not completed in the cache. Now, the code waits until the download is completed. Closes #1278
This commit is contained in:
parent
2e72b57f2f
commit
0bb2a8e0d0
2 changed files with 63 additions and 5 deletions
5
internal/cache/cache.go
vendored
5
internal/cache/cache.go
vendored
|
@ -155,10 +155,7 @@ func (c *Cache) IsNotExist(err error) bool {
|
|||
|
||||
// Wrap returns a backend with a cache.
|
||||
func (c *Cache) Wrap(be restic.Backend) restic.Backend {
|
||||
return &Backend{
|
||||
Backend: be,
|
||||
Cache: c,
|
||||
}
|
||||
return newBackend(be, c)
|
||||
}
|
||||
|
||||
// BaseDir returns the base directory.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue