Merge branch 'develop' into interface

Conflicts:
	app/assets/javascripts/app/controllers/ticket_zoom.js.coffee
This commit is contained in:
Martin Edenhofer 2014-11-06 21:48:40 +01:00
commit 252e1e0b48

View file

@ -140,7 +140,7 @@ returns
destroy session
Sessions.destory?(client_id)
Sessions.destory(client_id)
returns
@ -169,7 +169,7 @@ returns
list_of_closed_sessions = []
clients = Sessions.list
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
Sessions.destory( client_id )
end
@ -221,9 +221,14 @@ returns
=end
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
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
File.open( session_file, 'rb' ) { |file|
file.flock( File::LOCK_EX )
@ -232,9 +237,9 @@ returns
data = Marshal.load( all )
}
rescue Exception => e
File.delete(session_file)
puts "Error reading '#{session_file}':"
puts e.inspect
self.destory(client_id)
puts "ERROR: reading session file '#{session_file}', remove session."
return
end
data