Skip to content
Merged
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions superset/models/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ def data(self) -> Dict[str, Any]:
}

@cache.memoize(
# manually maintain cache key version
make_name=lambda fname: f"{fname}-v1",
make_name=lambda fname: f"{fname}-v0.1",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why not v2?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I guess that works, too. Just thought this feature is still unstable so let's start with something small.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

fair enough

timeout=config["DASHBOARD_CACHE_TIMEOUT"],
unless=lambda: not is_feature_enabled("DASHBOARD_CACHE"),
)
Expand Down Expand Up @@ -294,7 +293,7 @@ def update_thumbnail(self) -> None:

@debounce(0.1)
def clear_cache(self) -> None:
cache.delete_memoized(self.full_data)

@ktmud ktmud Oct 14, 2020

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The original code only updates the hash version related to the function: https://github.com/sh4nks/flask-caching/blob/v1.9.0/flask_caching/__init__.py#L1051-L1052

cache.delete_memoized(Dashboard.full_data, self)

@classmethod
@debounce(0.1)
Expand Down