forked from TrueCloudLab/restic
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.go | ||
backend_test.go | ||
cache.go | ||
cache_test.go | ||
dir.go | ||
dir_test.go | ||
file.go | ||
file_test.go | ||
testing.go |