fix: delete the correct dashboard cache key#11273
Conversation
There was a problem hiding this comment.
why do we need to disable this lint error here?
There was a problem hiding this comment.
I guess that works, too. Just thought this feature is still unstable so let's start with something small.
c8010b9 to
13b9039
Compare
|
|
||
| @debounce(0.1) | ||
| def clear_cache(self) -> None: | ||
| cache.delete_memoized(self.full_data) |
There was a problem hiding this comment.
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
|
Updated the cache key nonetheless! |
Codecov Report
@@ Coverage Diff @@
## master #11273 +/- ##
==========================================
- Coverage 65.60% 65.60% -0.01%
==========================================
Files 834 834
Lines 39566 39559 -7
Branches 3615 3610 -5
==========================================
- Hits 25959 25954 -5
+ Misses 13498 13496 -2
Partials 109 109
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
* bugfix: delete dashboard cache key correctly * update version number
* bugfix: delete dashboard cache key correctly * update version number
* bugfix: delete dashboard cache key correctly * update version number
SUMMARY
This PR fixes a bug from #11234 where cache keys for dashboard bootstrap data are incorrectly deleted.
We noticed this when some dashboard failed to update cache when updating charts.
delete_memoizedfrom Flask caching treats instance method and class method differently:BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TEST PLAN
ADDITIONAL INFORMATION