Commit f2b3e0e89fb7de0b8ff61b48d3f2c87b42faa1f3

Authored by Elena.Budnik
1 parent 2f2931b7

ajax timeout = gateway timeout

Showing 2 changed files with 16 additions and 7 deletions   Show diff stats
desktop.php
... ... @@ -7,7 +7,6 @@
7 7  
8 8  
9 9 require_once('php/config.php');
10   -
11 10 // error_reporting(E_ALL);
12 11 if (!isset($_POST['username'])) {
13 12 header('Location: index.html');
... ... @@ -107,6 +106,8 @@
107 106 var max_uploaded_file_size = '<?php echo MAX_UPLOADED_FILESIZE; ?>';
108 107 var guestSessionDuration = '<?php echo GuestSessionDuration*60; ?>'; // in secs
109 108 var maxGuestTimeInterval = '<?php echo MaxGuestTimeInterval; ?>'; // in days
  109 +
  110 + var gatewayTimeout = '<?php if (defined('GATEWAY_TIMEOUT')) echo GATEWAY_TIMEOUT; else echo 300000; ?>'; // in msec
110 111  
111 112 var logExecTime = <?php echo (LOG_EXEC_TIME === TRUE ? 'true' : 'false'); ?>;
112 113  
... ... @@ -166,15 +167,23 @@
166 167 Ext.onReady(function () {
167 168 //TODO update jobsStatus onLogin
168 169 Ext.Ajax.extraParams = {sessionID : sessionID};
169   - Ext.Ajax.timeout = 600000;
170   - Ext.Ajax.on('requestexception', function(conn, response, options, e) {
  170 + Ext.Ajax.timeout = gatewayTimeout; // msec ; should be the same value (or less) as gateway timeout
  171 +
  172 + Ext.Ajax.on('requestexception', function(conn, response, options, e) {
  173 +
171 174 if (loadMask && loadMask.isMasked())
172 175 loadMask.hide();
173   - if (response && response.statusText)
174   - myDesktopApp.errorMsg(response.statusText);
  176 +
  177 + if (response && response.statusText) {
  178 + if (response.timedout)
  179 + myDesktopApp.errorMsg('Request processing time exceeds gateway timeout.<br/>In case of parameter from Remote Bases : please re-launch the same request in 10 min,<br/>otherwise contact AMDA team');
  180 + else
  181 + myDesktopApp.errorMsg(response.statusText);
  182 + }
175 183 else
176 184 myDesktopApp.errorMsg('Communication failure');
177 185 });
  186 +
178 187 // backspace key disable
179 188 Ext.EventManager.on(window, 'keydown', function(e, t) {
180 189 if (e.getKey() == e.BACKSPACE && ((!/^input$/i.test(t.tagName) && !/^textarea$/i.test(t.tagName)) || t.disabled || t.readOnly)) {
... ...
js/app/models/ExecutableNode.js
... ... @@ -57,10 +57,10 @@ Ext.define(&#39;amdaModel.ExecutableNode&#39;, {
57 57  
58 58 //AKKA - Rework of the result treatment for the integration with the new kernel
59 59 if (!e.status){
60   - myDesktopApp.errorMsg('Internal error during request');
  60 + // myDesktopApp.errorMsg('Internal error during request');
61 61 return;
62 62 }
63   -
  63 +
64 64 if (!res.success){
65 65 myDesktopApp.errorMsg(res.message);
66 66 return;
... ...