Improved file lock.
This commit is contained in:
parent
57d1d8288b
commit
a6625c9467
1 changed files with 1 additions and 1 deletions
|
@ -68,12 +68,12 @@ module Session
|
|||
File.open( session_file, 'rb' ) { |file|
|
||||
file.flock( File::LOCK_EX )
|
||||
all = file.read
|
||||
file.flock( File::LOCK_UN )
|
||||
begin
|
||||
data = Marshal.load( all )
|
||||
rescue
|
||||
return
|
||||
end
|
||||
file.flock( File::LOCK_UN )
|
||||
}
|
||||
return data
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue