@@ -526,74 +526,4 @@ test.group('One tier tests', () => {
526526 // Original value should still be intact
527527 assert . equal ( await cache . get ( { key : 'key1' } ) , 'initial' )
528528 } )
529-
530- test ( 'getOrSet() should recalculate value when tags change' , async ( { assert } ) => {
531- const { cache } = new CacheFactory ( ) . withMemoryL1 ( ) . create ( )
532-
533- let factoryCallCount = 0
534- const factory = ( ) => {
535- factoryCallCount ++
536- return `value-${ factoryCallCount } `
537- }
538-
539- // First call with specific tags
540- const result1 = await cache . getOrSet ( {
541- key : 'test-key' ,
542- factory,
543- tags : [ 'labels' , 'settings' ] ,
544- ttl : '5m' ,
545- } )
546-
547- assert . equal ( result1 , 'value-1' )
548- assert . equal ( factoryCallCount , 1 )
549-
550- // Second call with same key but different tags
551- // This should trigger the factory again because tags have changed
552- const result2 = await cache . getOrSet ( {
553- key : 'test-key' ,
554- factory,
555- tags : [ 'labels' , 'datasets' , 'settings' ] ,
556- ttl : '5m' ,
557- } )
558-
559- assert . equal ( result2 , 'value-2' )
560- assert . equal ( factoryCallCount , 2 )
561- } )
562-
563- test ( 'should be able to deleteByTag if tags changed' , async ( { assert } ) => {
564- const { cache } = new CacheFactory ( ) . withMemoryL1 ( ) . create ( )
565-
566- let factoryCallCount = 0
567- const factory = ( ) => {
568- factoryCallCount ++
569- return `value-${ factoryCallCount } `
570- }
571-
572- const result1 = await cache . getOrSet ( {
573- key : 'test-key' ,
574- factory,
575- tags : [ 'labels' , 'settings' ] ,
576- ttl : '5m' ,
577- } )
578-
579- const result2 = await cache . getOrSet ( {
580- key : 'test-key' ,
581- factory,
582- tags : [ 'labels' , 'datasets' , 'settings' ] ,
583- ttl : '5m' ,
584- } )
585-
586- await cache . deleteByTag ( { tags : [ 'datasets' ] } )
587-
588- const result3 = await cache . getOrSet ( {
589- key : 'test-key' ,
590- factory,
591- tags : [ 'labels' , 'datasets' , 'settings' ] ,
592- ttl : '5m' ,
593- } )
594-
595- assert . equal ( result1 , 'value-1' )
596- assert . equal ( result2 , 'value-2' )
597- assert . equal ( result3 , 'value-3' )
598- } )
599529} )
0 commit comments