Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
File should be open in read/write mode. When doing lock on a file.
  • Loading branch information
arunagw authored and tenderlove committed Apr 18, 2011
1 parent 3b0f917 commit 92537b8
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 @@ -121,7 +121,7 @@ def delete_entry(key, options)
# 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
Expand Down

0 comments on commit 92537b8

Please sign in to comment.