Skip to content

Commit

Permalink
fix: cache issue for api/v1/query (apache#7507)
Browse files Browse the repository at this point in the history
  • Loading branch information
conglei authored and kristw committed May 14, 2019
1 parent e4f02d3 commit b19d0fb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions superset/common/query_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,16 +206,16 @@ def get_df_payload(self, query_obj, **kwargs):
df=df if df is not None else None,
query=query,
)
cache_value = pkl.dumps(
cache_binary = pkl.dumps(
cache_value, protocol=pkl.HIGHEST_PROTOCOL)

logging.info('Caching {} chars at key {}'.format(
len(cache_value), cache_key))
len(cache_binary), cache_key))

stats_logger.incr('set_cache_key')
cache.set(
cache_key,
cache_value,
cache_value=cache_binary,
timeout=self.cache_timeout)
except Exception as e:
# cache.set call can fail if the backend is down or if
Expand Down

0 comments on commit b19d0fb

Please sign in to comment.