Skip to content

Commit

Permalink
Merge pull request #213 from airbnb/kim/fix_druid_datasource_bug
Browse files Browse the repository at this point in the history
Fix a bug when loading DruidDatasource.
  • Loading branch information
mistercrunch committed Mar 31, 2016
2 parents fd40742 + e5553ab commit 5b7fe2b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions caravel/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +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
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 5b7fe2b

Please sign in to comment.