Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
30 | protected function getShardNameForTag(string $tag, string $key): string |
||
31 | { |
||
32 | // Usa lo stesso algoritmo di sharding della cache manager |
||
33 | $hash = crc32($key); |
||
34 | $numShards = (int) config('supercache.num_shards'); |
||
35 | $shardIndex = $hash % $numShards; |
||
36 | |||
37 | return config('supercache.prefix') . 'tag:' . $tag . ':shard:' . $shardIndex; |
||
38 | } |
||
40 |