Try to avoid "Mysql2::Error: This connection is in use by: #<Thread:0x00000001b5af80 sleep".

This commit is contained in:
Martin Edenhofer 2013-08-28 08:40:02 +02:00
parent 95310601a8
commit 8a4c3388e4

View file

@ -119,7 +119,10 @@ class LongPollingController < ApplicationController
begin
# update last ping
sleep 1
4.times {|loop|
sleep 0.25
}
#sleep 1
Sessions.touch( client_id )
# set max loop time to 24 sec. because of 30 sec. timeout of mod_proxy
@ -132,7 +135,10 @@ class LongPollingController < ApplicationController
render :json => queue
return
end
sleep 2
8.times {|loop|
sleep 0.25
}
#sleep 2
if count == 0
render :json => { :action => 'pong' }
return