1
0
mirror of https://github.com/restic/restic.git synced 2024-07-19 11:17:31 +02:00
restic/internal/cache
Michael Eischer e734746f75 cache: forget cached file at most once
This is inspired by the circuit breaker pattern used for distributed
systems. If too many requests fails, then it is better to immediately
fail new requests for a limited time to give the backend time to
recover.

By only forgetting a file in the cache at most once, we can ensure that
a broken file is only retrieved once again from the backend. If the file
stored there is broken, previously it would be cached and deleted
continuously. Now, it is retrieved only once again, all later requests
just use the cached copy and either succeed or fail immediately.
2024-05-18 21:28:54 +02:00
..
backend_test.go repository: move backend.LoadAll to repository.LoadRaw 2024-05-18 21:26:00 +02:00
backend.go cache: forget cached file at most once 2024-05-18 21:28:54 +02:00
cache_test.go cache: Restructure New to remove redundant operations 2023-05-27 10:32:08 +02:00
cache.go cache: forget cached file at most once 2024-05-18 21:28:54 +02:00
dir_test.go Add more error handling 2021-01-30 20:19:47 +01:00
dir.go Honor RESTIC_CACHE_DIR environment variable 2021-10-10 16:00:02 +02:00
file_test.go cache: Always use cached file if it exists 2024-05-18 21:28:54 +02:00
file.go cache: forget cached file at most once 2024-05-18 21:28:54 +02:00
testing.go test: Use testing.T.Cleanup to remove tempdirs 2022-12-09 14:23:55 +01:00