mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make FileStore use atomic writes
This commit is contained in:
parent
e5b1ab7cc3
commit
dfc83566b3
1 changed files with 1 additions and 1 deletions
|
@ -15,7 +15,7 @@ module ActiveSupport
|
|||
def write(name, value, options = nil)
|
||||
super
|
||||
ensure_cache_path(File.dirname(real_file_path(name)))
|
||||
File.open(real_file_path(name), "wb+") { |f| f.write(value) }
|
||||
File.atomic_write(real_file_path(name)) { |f| f.write(value) }
|
||||
rescue => e
|
||||
RAILS_DEFAULT_LOGGER.error "Couldn't create cache directory: #{name} (#{e.message})" if RAILS_DEFAULT_LOGGER
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue