mirror of
https://github.com/octoleo/restic.git
synced 2024-12-26 04:17:29 +00:00
e734746f75
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. |
||
---|---|---|
.. | ||
backend_test.go | ||
backend.go | ||
cache_test.go | ||
cache.go | ||
dir_test.go | ||
dir.go | ||
file_test.go | ||
file.go | ||
testing.go |