Skip to content

Commit

Permalink
Ignore Errno::ENOTEMPTY when calling AS::Cache::FileStore#clear with …
Browse files Browse the repository at this point in the history
…race conditions

Currently `Rails.cache.clear` raises Errno::ENOTEMPTY on highly accessed server.
The error just can be ignored.
  • Loading branch information
ts-3156 committed Aug 15, 2019
1 parent 8ab4fd1 commit b7e440e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion activesupport/lib/active_support/cache/file_store.rb
Expand Up @@ -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.
Expand Down

0 comments on commit b7e440e

Please sign in to comment.