Optional cache bypass

This commit is contained in:
Javier Feliz 2025-09-11 20:44:08 -04:00
parent dc5ab759f2
commit d79c95f617

View File

@ -74,6 +74,11 @@ impl Cache {
where where
T: Serialize + DeserializeOwned + Clone, T: Serialize + DeserializeOwned + Clone,
{ {
// Check if caching is disabled via environment variable
if std::env::var("WAYCAST_NO_CACHE").is_ok() {
return Ok(compute());
}
// Try to get from cache first // Try to get from cache first
if let Some(entry) = self.get_cached_entry::<T>(key)? { if let Some(entry) = self.get_cached_entry::<T>(key)? {
// Check if entry has expired // Check if entry has expired