diff options
| author | ARC <arjunrc@gmail.com> | 2015-05-13 14:09:57 -0400 |
|---|---|---|
| committer | ARC <arjunrc@gmail.com> | 2015-05-13 14:09:57 -0400 |
| commit | 5a3af8dab3f4739592ad5505f7ed858ac7280cd9 (patch) | |
| tree | 8398d8c6d7b5da3cb380ac66451be568d955cd4f | |
| parent | efed1a2509347eab5b52c118b43568ad8d200e46 (diff) | |
removed http timeout for start/stop/restart APIs - as they take more time to complete
| -rw-r--r-- | www/js/StateCtrl.js | 10 | ||||
| -rw-r--r-- | www/js/app.js | 13 |
2 files changed, 16 insertions, 7 deletions
diff --git a/www/js/StateCtrl.js b/www/js/StateCtrl.js index 9d73a818..79b2490b 100644 --- a/www/js/StateCtrl.js +++ b/www/js/StateCtrl.js @@ -121,12 +121,12 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' }, function (error) { - if (error.status) // it seems to return error with status 0 if ok - { + //if (error.status) // it seems to return error with status 0 if ok + // { console.log("ERROR in Change State:"+JSON.stringify(error)); $scope.zmRun = 'undetermined'; $scope.color='color:orange;'; - } - else + // } + /*else { switch (str) { @@ -138,7 +138,7 @@ angular.module('zmApp.controllers').controller('zmApp.StateCtrl', ['$ionicPopup' } inProgress = 0; - } + }*/ } diff --git a/www/js/app.js b/www/js/app.js index dd81cbac..6af0dc5a 100644 --- a/www/js/app.js +++ b/www/js/app.js @@ -43,8 +43,17 @@ angular.module('zmApp', [ //console.log("*** HTTP INTERCEPTOR CALLED ***"); return { 'request': function (config) { - config.timeout = 15000; - //console.log("*** HTTP INTERCEPTOR CALLED ***"); + if ( !(config.url.indexOf("stop.json") > -1 || + config.url.indexOf("start.json") > -1 || + config.url.indexOf("restart.json") > -1 )) + { + config.timeout = 15000; + } + else + { + console.log ("HTTP INTERCEPT:Skipping HTTP timeout for "+config.url); + } + //console.log("*** HTTP URL INTERCEPTOR CALLED with "+config.url+" ***"); return config; } |
