From cdf2b96aa7f67b9dd30c9ac45911bf27cec31047 Mon Sep 17 00:00:00 2001 From: Chris Gaffney Date: Thu, 17 Jul 2025 13:51:21 -0400 Subject: [PATCH] Only attempt to sweep the cache when cache sweeping is enabled This mirrors code in the railtie that effectively enables cache sweeping only in development unless otherwise configured. --- lib/propshaft/server.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/propshaft/server.rb b/lib/propshaft/server.rb index 6f877115..98e4c401 100644 --- a/lib/propshaft/server.rb +++ b/lib/propshaft/server.rb @@ -47,6 +47,8 @@ def extract_path_and_digest(env) end def execute_cache_sweeper_if_updated - @assembly.load_path.cache_sweeper.execute_if_updated + if @assembly.config.sweep_cache + @assembly.load_path.cache_sweeper.execute_if_updated + end end end