diff options
author | Arun Agrawal <arun@fromjaipur.com> | 2011-04-18 17:06:07 +0530 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-18 09:08:53 -0700 |
commit | 92537b8c273ea57eb7e1d686071f1876a5e9abe4 (patch) | |
tree | f46643af8df972454c5f01edcc2736b01cbc7f6e /activesupport/lib/active_support/cache | |
parent | 3b0f917b1dfabce6a6b338e4a7cb02995c055596 (diff) | |
download | rails-92537b8c273ea57eb7e1d686071f1876a5e9abe4.tar.gz rails-92537b8c273ea57eb7e1d686071f1876a5e9abe4.tar.bz2 rails-92537b8c273ea57eb7e1d686071f1876a5e9abe4.zip |
File should be open in read/write mode. When doing lock on a file.
Diffstat (limited to 'activesupport/lib/active_support/cache')
-rw-r--r-- | activesupport/lib/active_support/cache/file_store.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/cache/file_store.rb b/activesupport/lib/active_support/cache/file_store.rb index 9936b33e22..a1376ae52a 100644 --- a/activesupport/lib/active_support/cache/file_store.rb +++ b/activesupport/lib/active_support/cache/file_store.rb @@ -121,7 +121,7 @@ module ActiveSupport # Lock a file for a block so only one process can modify it at a time. def lock_file(file_name, &block) # :nodoc: if File.exist?(file_name) - File.open(file_name, 'r') do |f| + File.open(file_name, 'r+') do |f| begin f.flock File::LOCK_EX yield |