From becd23ccc45b182a48a72315f61b2d3fe04c020e Mon Sep 17 00:00:00 2001 From: Ermal Kaleci Date: Fri, 29 Sep 2023 12:33:09 +0200 Subject: [PATCH] fix --- src/middlewares/methods/cache.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/middlewares/methods/cache.rs b/src/middlewares/methods/cache.rs index 58b32b6..ea0a696 100644 --- a/src/middlewares/methods/cache.rs +++ b/src/middlewares/methods/cache.rs @@ -46,7 +46,9 @@ impl MiddlewareBuilder for CacheMiddleware { }; let ttl_seconds = match method.cache { - Some(CacheParams { ttl_seconds, .. }) => ttl_seconds, + Some(CacheParams { ttl_seconds, .. }) => { + ttl_seconds.or(cache_ext.config.default_ttl_seconds) + } None => cache_ext.config.default_ttl_seconds, };