File tree Expand file tree Collapse file tree
packages/cache/src/providers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828 "eslint/no-undefined" : " off" ,
2929 "eslint/no-empty-function" : " off" ,
3030 "eslint/no-continue" : " off" ,
31+ "eslint/max-depth" : " off" ,
3132 "eslint/max-statements" : " off" ,
3233 "eslint/no-implicit-coercion" : " off" ,
3334 "eslint/no-plusplus" : " off" ,
Original file line number Diff line number Diff line change @@ -22,18 +22,22 @@ export class MemoryCacheProvider implements CacheProvider {
2222 if ( entryIsExpired ( entry ) ) {
2323 this . entryStore . delete ( key )
2424 this . options ?. onIntervalExpiration ?.( entry )
25- }
26- }
2725
28- for ( const [ tag , keys ] of this . tagStore ) {
29- for ( const key of keys ) {
30- if ( ! this . entryStore . has ( key ) ) {
31- keys . delete ( key )
32- }
33- }
26+ if ( entry . options . tags ) {
27+ for ( const tag of entry . options . tags ) {
28+ const keys = this . tagStore . get ( tag )
3429
35- if ( keys . size === 0 ) {
36- this . tagStore . delete ( tag )
30+ if ( ! keys ) {
31+ continue
32+ }
33+
34+ keys . delete ( key )
35+
36+ if ( keys . size === 0 ) {
37+ this . tagStore . delete ( tag )
38+ }
39+ }
40+ }
3741 }
3842 }
3943 }
@@ -66,11 +70,15 @@ export class MemoryCacheProvider implements CacheProvider {
6670 for ( const tag of options . tags ) {
6771 const keys = this . tagStore . get ( tag )
6872
69- if ( keys ) {
70- for ( const key of keys ) {
71- this . entryStore . delete ( key )
72- }
73+ if ( ! keys ) {
74+ continue
7375 }
76+
77+ for ( const key of keys ) {
78+ this . entryStore . delete ( key )
79+ }
80+
81+ this . tagStore . delete ( tag )
7482 }
7583 }
7684
You can’t perform that action at this time.
0 commit comments