Skip to content

Commit

Permalink
fix: use dashboard id for stable cache key (apache#11293)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktmud authored and villebro committed Oct 19, 2020
1 parent a123b24 commit 5e66735
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions superset/models/dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class Dashboard( # pylint: disable=too-many-instance-attributes
]

def __repr__(self) -> str:
return f"Dashboard<{self.slug or self.id}>"
return f"Dashboard<{self.id or self.slug}>"

@property
def table_names(self) -> str:
Expand Down Expand Up @@ -253,7 +253,7 @@ def data(self) -> Dict[str, Any]:

@cache.memoize(
# manage cache version manually
make_name=lambda fname: f"{fname}-v2",
make_name=lambda fname: f"{fname}-v2.1",
timeout=config["DASHBOARD_CACHE_TIMEOUT"],
unless=lambda: not is_feature_enabled("DASHBOARD_CACHE"),
)
Expand Down

0 comments on commit 5e66735

Please sign in to comment.