diff options
-rw-r--r-- | javascripts/dashing.coffee | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/javascripts/dashing.coffee b/javascripts/dashing.coffee index ee4b6d4..fa677e8 100644 --- a/javascripts/dashing.coffee +++ b/javascripts/dashing.coffee @@ -94,12 +94,15 @@ Dashing.debugMode = false source = new EventSource('events') source.addEventListener 'open', (e) -> - console.log("Connection opened") + console.log("Connection opened", e) source.addEventListener 'error', (e)-> - console.log("Connection error") - if (e.readyState == EventSource.CLOSED) + console.log("Connection error", e) + if (e.currentTarget.readyState == EventSource.CLOSED) console.log("Connection closed") + setTimeout (-> + window.location.reload() + ), 5*60*1000 source.addEventListener 'message', (e) -> data = JSON.parse(e.data) |