From d72c63a13df7f1e6173cf5b431a64b629bb294f9 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Mon, 17 Jun 2013 15:08:51 +0200 Subject: [PATCH] Fixed timestamp for spool:sent event. --- app/controllers/long_polling_controller.rb | 3 ++- script/websocket-server.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/long_polling_controller.rb b/app/controllers/long_polling_controller.rb index 6617effbd..89ce5e723 100644 --- a/app/controllers/long_polling_controller.rb +++ b/app/controllers/long_polling_controller.rb @@ -47,7 +47,7 @@ class LongPollingController < ApplicationController # send spool:sent event to client sleep 0.2 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 @@ -110,6 +110,7 @@ class LongPollingController < ApplicationController begin # update last ping + sleep 1 Session.touch( client_id ) # set max loop time to 28 sec. because of 30 sec. timeout of mod_proxy diff --git a/script/websocket-server.rb b/script/websocket-server.rb index ec51b2f13..e5384439c 100755 --- a/script/websocket-server.rb +++ b/script/websocket-server.rb @@ -154,7 +154,7 @@ EventMachine.run { # send spool:sent event to client 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 # get session