Merge branch 'develop' into interface
Conflicts: app/assets/javascripts/app/controllers/ticket_zoom.js.coffee
This commit is contained in:
commit
252e1e0b48
1 changed files with 11 additions and 6 deletions
|
@ -140,7 +140,7 @@ returns
|
||||||
|
|
||||||
destroy session
|
destroy session
|
||||||
|
|
||||||
Sessions.destory?(client_id)
|
Sessions.destory(client_id)
|
||||||
|
|
||||||
returns
|
returns
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ returns
|
||||||
list_of_closed_sessions = []
|
list_of_closed_sessions = []
|
||||||
clients = Sessions.list
|
clients = Sessions.list
|
||||||
clients.each { |client_id, client|
|
clients.each { |client_id, client|
|
||||||
if ( client[:meta][:last_ping].to_i + ( 60 * idle_time_in_min ) ) < Time.now.to_i
|
if !client[:meta] || !client[:meta][:last_ping] || ( client[:meta][:last_ping].to_i + ( 60 * idle_time_in_min ) ) < Time.now.to_i
|
||||||
list_of_closed_sessions.push client_id
|
list_of_closed_sessions.push client_id
|
||||||
Sessions.destory( client_id )
|
Sessions.destory( client_id )
|
||||||
end
|
end
|
||||||
|
@ -221,9 +221,14 @@ returns
|
||||||
=end
|
=end
|
||||||
|
|
||||||
def self.get( client_id )
|
def self.get( client_id )
|
||||||
session_file = @path + '/' + client_id.to_s + '/session'
|
session_dir = @path + '/' + client_id.to_s
|
||||||
|
session_file = session_dir + '/session'
|
||||||
data = nil
|
data = nil
|
||||||
return if !File.exist? session_file
|
if !File.exist? session_file
|
||||||
|
self.destory(client_id)
|
||||||
|
puts "ERROR: missing session file for '#{client_id.to_s}', remove session."
|
||||||
|
return
|
||||||
|
end
|
||||||
begin
|
begin
|
||||||
File.open( session_file, 'rb' ) { |file|
|
File.open( session_file, 'rb' ) { |file|
|
||||||
file.flock( File::LOCK_EX )
|
file.flock( File::LOCK_EX )
|
||||||
|
@ -232,9 +237,9 @@ returns
|
||||||
data = Marshal.load( all )
|
data = Marshal.load( all )
|
||||||
}
|
}
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
File.delete(session_file)
|
|
||||||
puts "Error reading '#{session_file}':"
|
|
||||||
puts e.inspect
|
puts e.inspect
|
||||||
|
self.destory(client_id)
|
||||||
|
puts "ERROR: reading session file '#{session_file}', remove session."
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
data
|
data
|
||||||
|
|
Loading…
Reference in a new issue