superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Pass in cache timeout for async queries (#4436)
Date Fri, 16 Feb 2018 01:53:05 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 7922ccf  Pass in cache timeout for async queries (#4436)
7922ccf is described below

commit 7922ccfddc9362b615a3f2959eb5110233881c45
Author: Jeffrey Wang <jeffreywang93@gmail.com>
AuthorDate: Thu Feb 15 20:53:00 2018 -0500

    Pass in cache timeout for async queries (#4436)
    
    * Pass in cache timeout for async queries
    
    * Default cache timeout to 0 if default env var is not set
    
    * check for 0 timeout
---
 superset/sql_lab.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/superset/sql_lab.py b/superset/sql_lab.py
index 87a6b44..64deaff 100644
--- a/superset/sql_lab.py
+++ b/superset/sql_lab.py
@@ -272,7 +272,10 @@ def execute_sql(
         key = '{}'.format(uuid.uuid4())
         logging.info('Storing results in results backend, key: {}'.format(key))
         json_payload = json.dumps(payload, default=utils.json_iso_dttm_ser)
-        results_backend.set(key, utils.zlib_compress(json_payload))
+        cache_timeout = database.cache_timeout
+        if cache_timeout is None:
+            cache_timeout = config.get('CACHE_DEFAULT_TIMEOUT', 0)
+        results_backend.set(key, utils.zlib_compress(json_payload), cache_timeout)
         query.results_key = key
         query.end_result_backend_time = utils.now_as_float()
 

-- 
To stop receiving notification emails like this one, please contact
maximebeauchemin@apache.org.

Mime
View raw message