jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From i..@apache.org
Subject svn commit: r1560313 - in /jena/branches/jena-fuseki-new-ui/pages: js/app/services/ping-service.js ping.txt
Date Wed, 22 Jan 2014 11:11:30 GMT
Author: ijd
Date: Wed Jan 22 11:11:30 2014
New Revision: 1560313

URL: http://svn.apache.org/r1560313
Log:
Change to use ping endpoint in management API

Removed:
    jena/branches/jena-fuseki-new-ui/pages/ping.txt
Modified:
    jena/branches/jena-fuseki-new-ui/pages/js/app/services/ping-service.js

Modified: jena/branches/jena-fuseki-new-ui/pages/js/app/services/ping-service.js
URL: http://svn.apache.org/viewvc/jena/branches/jena-fuseki-new-ui/pages/js/app/services/ping-service.js?rev=1560313&r1=1560312&r2=1560313&view=diff
==============================================================================
--- jena/branches/jena-fuseki-new-ui/pages/js/app/services/ping-service.js (original)
+++ jena/branches/jena-fuseki-new-ui/pages/js/app/services/ping-service.js Wed Jan 22 11:11:30
2014
@@ -5,6 +5,7 @@
 define( ['jquery', 'underscore', 'sprintf'],
   function( $, _, sprintf ) {
 
+    var PING_URL = "$/ping"
     var DEFAULT_PING_TIME = 5000;
     var _startTime = 0;
 
@@ -30,14 +31,19 @@ define( ['jquery', 'underscore', 'sprint
                                       .attr( "title", statusText );
     };
 
+    /** Return a cache-defeating ping URL */
+    var ping_url = function() {
+      return PING_URL + "?_=" + Math.random();
+    };
+
     var start = function( period ) {
       ping( period || DEFAULT_PING_TIME );
     };
 
     var ping = function( period ) {
       onBeforeSend();
-      $.getJSON( "/ping.txt" ).done( onPingSuccess )
-                          .fail( onPingFail );
+      $.get( ping_url() ).done( onPingSuccess )
+                         .fail( onPingFail );
       setTimeout( function() {ping( period );}, period );
     };
 



Mime
View raw message