Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug when loading DruidDatasource. #213

Merged
merged 3 commits into from
Mar 31, 2016
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not put on the previous line?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It exceeds the line limit, which Max set to be 90 @hongbozeng

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