Skip to content

Commit

Permalink
A better fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
kim-pham-airbnb committed Mar 30, 2016
1 parent f67c6b5 commit 4a77b70
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions caravel/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,11 +217,12 @@ def query_obj(self):
def cache_timeout(self):
if self.slice and self.slice.cache_timeout:
return self.slice.cache_timeout
return (
self.datasource.cache_timeout or
# Kim: comment this out since it caused a bug for DruidDatasource.
# self.datasource.database.cache_timeout or
config.get("CACHE_DEFAULT_TIMEOUT"))
if self.datasource.cache_timeout:
return self.datasource.cache_timeout
if hasattr(self.datasource, 'database') \
and self.datasource.database.cache_timeout:
return self.datasource.database.cache_timeout
return config.get("CACHE_DEFAULT_TIMEOUT")

def get_json(self):
"""Handles caching around the json payload retrieval"""
Expand Down

0 comments on commit 4a77b70

Please sign in to comment.