1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Merge pull request #36941 from ts-3156/master

Ignore Errno::ENOTEMPTY when calling AS::Cache::FileStore#clear with race conditions
This commit is contained in:
Rafael França 2020-04-13 16:19:49 -04:00 committed by GitHub
commit a0fb2b2227
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,7 +36,7 @@ module ActiveSupport
def clear(options = nil) def clear(options = nil)
root_dirs = (Dir.children(cache_path) - GITKEEP_FILES) root_dirs = (Dir.children(cache_path) - GITKEEP_FILES)
FileUtils.rm_r(root_dirs.collect { |f| File.join(cache_path, f) }) FileUtils.rm_r(root_dirs.collect { |f| File.join(cache_path, f) })
rescue Errno::ENOENT rescue Errno::ENOENT, Errno::ENOTEMPTY
end end
# Preemptively iterates through all stored keys and removes the ones which have expired. # Preemptively iterates through all stored keys and removes the ones which have expired.