fix: delete the correct dashboard cache key (#11273)

* bugfix: delete dashboard cache key correctly

* update version number
This commit is contained in:
Jesse Yang 2020-10-14 15:37:59 -07:00 committed by GitHub
parent a6224a2ed2
commit 0262daa228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -252,8 +252,8 @@ class Dashboard( # pylint: disable=too-many-instance-attributes
}
@cache.memoize(
# manually maintain cache key version
make_name=lambda fname: f"{fname}-v1",
# manage cache version manually
make_name=lambda fname: f"{fname}-v2",
timeout=config["DASHBOARD_CACHE_TIMEOUT"],
unless=lambda: not is_feature_enabled("DASHBOARD_CACHE"),
)
@ -294,7 +294,7 @@ class Dashboard( # pylint: disable=too-many-instance-attributes
@debounce(0.1)
def clear_cache(self) -> None:
cache.delete_memoized(self.full_data)
cache.delete_memoized(Dashboard.full_data, self)
@classmethod
@debounce(0.1)