Fixed timestamp for spool:sent event.

This commit is contained in:
Martin Edenhofer 2013-06-17 15:08:51 +02:00
parent 70ceaf455f
commit d72c63a13d
2 changed files with 3 additions and 2 deletions

View file

@ -47,7 +47,7 @@ class LongPollingController < ApplicationController
# send spool:sent event to client # send spool:sent event to client
sleep 0.2 sleep 0.2
log 'notice', "send spool:sent event", client_id log 'notice', "send spool:sent event", client_id
Session.send( client_id, { :event => 'spool:sent', :timestamp => Time.now.to_i } ) Session.send( client_id, { :event => 'spool:sent', :data => { :timestamp => Time.now.to_i } } )
end end
@ -110,6 +110,7 @@ class LongPollingController < ApplicationController
begin begin
# update last ping # update last ping
sleep 1
Session.touch( client_id ) Session.touch( client_id )
# set max loop time to 28 sec. because of 30 sec. timeout of mod_proxy # set max loop time to 28 sec. because of 30 sec. timeout of mod_proxy

View file

@ -154,7 +154,7 @@ EventMachine.run {
# send spool:sent event to client # send spool:sent event to client
log 'notice', "send spool:sent event", client_id log 'notice', "send spool:sent event", client_id
@clients[client_id][:websocket].send( '[{"event":"spool:sent","time":' + Time.now.to_i.to_s + '}]' ) @clients[client_id][:websocket].send( '[{"event":"spool:sent","data":{"timestamp":' + Time.now.to_i.to_s + '}}]' )
end end
# get session # get session