ctubbsii commented on a change in pull request #732: Monitor 2.0: Eliminate use 
of async:false for ajax requests
URL: https://github.com/apache/accumulo/pull/732#discussion_r228700321
 
 

 ##########
 File path: 
server/monitor/src/main/resources/org/apache/accumulo/monitor/resources/js/functions.js
 ##########
 @@ -317,7 +317,7 @@ function makePlot(id, inData, type) {
  * stores it on a sessionStorage variable
  */
 function getMaster() {
-  $.getJSON('/rest/master', function(data) {
+  return $.getJSON('/rest/master', function(data) {
 
 Review comment:
   I'm wondering if these functions which save endpoint data into the session 
can be further simplified, with something like:
   
   ```javascript
   function saveToSession(endpoint) {
     return $.getJSON(endpoint, function(data) { sessionStorage[endpoint] = 
JSON.stringify(data); } );
   }
   
   // the following are now simple enough to inline
   function getMaster() { return saveToSession('/rest/master'); }
   function getZk() { return saveToSession('/rest/zk'); }
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to