Explorar o código

[impala] Faster check status until 2s of execution

Romain Rigaux %!s(int64=11) %!d(string=hai) anos
pai
achega
86b23008ac
Modificáronse 2 ficheiros con 5 adicións e 2 borrados
  1. 3 1
      apps/beeswax/src/beeswax/api.py
  2. 2 1
      apps/beeswax/static/js/beeswax.vm.js

+ 3 - 1
apps/beeswax/src/beeswax/api.py

@@ -17,6 +17,7 @@
 
 import json
 import logging
+import re
 
 from django.core.urlresolvers import reverse
 from django.http import HttpResponse, Http404
@@ -70,8 +71,9 @@ def error_handler(view_fn):
         'message': message,
       }
 
-      if 'database is locked' in message or 'Invalid query handle' in message or 'not JSON serializable' in message:
+      if re.search('database is locked|Invalid query handle|not JSON serializable', message, re.IGNORECASE):
         response['status'] = 2 # Frontend will not display this type of error
+        LOG.warn('error_handler silencing the exception: %s' % e)
 
       return HttpResponse(json.dumps(response), mimetype="application/json", status=200)
   return decorator

+ 2 - 1
apps/beeswax/static/js/beeswax.vm.js

@@ -596,7 +596,7 @@ function BeeswaxViewModel(server) {
   };
 
   self.watchQueryLoop = function(fn) {
-    var TIMEOUT = 1000;
+    var TIMEOUT = 100;
     var timer = null;
 
     self.design.isRunning(true);
@@ -631,6 +631,7 @@ function BeeswaxViewModel(server) {
             // scroll logs
           }
 
+          TIMEOUT = Math.min(TIMEOUT + 100, 2000);
           timer = setTimeout(_fn, TIMEOUT);
         }
       });