Disables caching, returning whether we were previously enabled.
(&self)
| 127 | |
| 128 | /// Disables caching, returning whether we were previously enabled. |
| 129 | fn disable_caching(&self) -> bool { |
| 130 | // Disable and clear the cache of all existing values. |
| 131 | let was_enabled = self.policy.set_enabled(false); |
| 132 | self.cache |
| 133 | .write() |
| 134 | .expect("CachingSecretsReader panicked!") |
| 135 | .clear(); |
| 136 | |
| 137 | was_enabled |
| 138 | } |
| 139 | |
| 140 | /// Sets a new "time to live" for cache values, returning the old TTL. |
| 141 | fn set_ttl(&self, ttl: Duration) -> Duration { |