Try to avoid "Mysql2::Error: This connection is in use by: #<Thread:0x00000001b5af80 sleep".
This commit is contained in:
parent
95310601a8
commit
8a4c3388e4
1 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue