@@ -13,7 +13,7 @@ class ShardedD1TagCache implements NextModeTagCache {
1313 mode = "nextMode" as const ;
1414 public readonly name = "sharded-d1-tag-cache" ;
1515
16- constructor ( private opts : ShardedD1TagCacheOptions = { numberOfShards : 4 } ) { }
16+ constructor ( private opts : ShardedD1TagCacheOptions = { numberOfShards : 4 } ) { }
1717
1818 private getDurableObjectStub ( shardId : string ) {
1919 const durableObject = getCloudflareContext ( ) . env . NEXT_CACHE_D1_SHARDED ;
@@ -25,7 +25,10 @@ class ShardedD1TagCache implements NextModeTagCache {
2525
2626 private generateShards ( tags : string [ ] ) {
2727 // For each tag, we generate a message group id
28- const messageGroupIds = tags . map ( ( tag ) => ( { shardId : generateShardId ( tag , this . opts . numberOfShards , "shard" ) , tag } ) ) ;
28+ const messageGroupIds = tags . map ( ( tag ) => ( {
29+ shardId : generateShardId ( tag , this . opts . numberOfShards , "shard" ) ,
30+ tag,
31+ } ) ) ;
2932 // We group the tags by shard
3033 const shards = new Map < string , string [ ] > ( ) ;
3134 for ( const { shardId, tag } of messageGroupIds ) {
@@ -63,7 +66,7 @@ class ShardedD1TagCache implements NextModeTagCache {
6366 const shardsResult = await Promise . all (
6467 Array . from ( shards . entries ( ) ) . map ( async ( [ shardId , shardedTags ] ) => {
6568 const stub = this . getDurableObjectStub ( shardId ) ;
66- return stub . hasBeenRevalidated ( shardedTags , lastModified )
69+ return stub . hasBeenRevalidated ( shardedTags , lastModified ) ;
6770 } )
6871 ) ;
6972 return shardsResult . some ( ( result ) => result ) ;
0 commit comments