From 320734ea8a2cc518fe8f20b326d5c508afb40502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Fran=C3=A7a?= Date: Mon, 13 Apr 2020 16:19:49 -0400 Subject: [PATCH] Merge pull request #36941 from ts-3156/master Ignore Errno::ENOTEMPTY when calling AS::Cache::FileStore#clear with race conditions --- activesupport/lib/active_support/cache/file_store.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb index 66242132b54d3..ff1d6793beb5c 100644 --- a/activesupport/lib/active_support/cache/file_store.rb +++ b/activesupport/lib/active_support/cache/file_store.rb @@ -36,7 +36,7 @@ def self.supports_cache_versioning? def clear(options = nil) root_dirs = (Dir.children(cache_path) - GITKEEP_FILES) FileUtils.rm_r(root_dirs.collect { |f| File.join(cache_path, f) }) - rescue Errno::ENOENT + rescue Errno::ENOENT, Errno::ENOTEMPTY end # Preemptively iterates through all stored keys and removes the ones which have expired.