소스 검색

HUE-5451 [metastore] Fix js error in the create database wizard

Johan Ahlen 9 년 전
부모
커밋
eeb549e
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      desktop/core/src/desktop/static/desktop/js/apiHelper.js

+ 4 - 1
desktop/core/src/desktop/static/desktop/js/apiHelper.js

@@ -92,7 +92,10 @@ var ApiHelper = (function () {
   };
 
   ApiHelper.prototype.hasExpired = function (timestamp, cacheType) {
-    return (new Date()).getTime() - timestamp > (hueDebug.cacheTimeout || CACHEABLE_TTL[cacheType]);
+    if (typeof hueDebug !== 'undefined' && typeof hueDebug.cacheTimeout !== 'undefined') {
+      return (new Date()).getTime() - timestamp > hueDebug.cacheTimeout;
+    }
+    return (new Date()).getTime() - timestamp > CACHEABLE_TTL[cacheType];
   };
 
   /**