Skip to content

Commit 62f7c03

Browse files
IndraGunawanKocal
authored andcommitted
[Icons] use dedicated cache pool
1 parent 7bd9e0f commit 62f7c03

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

src/Icons/config/iconify.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
->set('.ux_icons.iconify', Iconify::class)
2929
->args([
30-
service('cache.system'),
30+
service('.ux_icons.cache'),
3131
abstract_arg('endpoint'),
3232
service('http_client')->nullOnInvalid(),
3333
])

src/Icons/config/services.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@
2424

2525
return static function (ContainerConfigurator $container): void {
2626
$container->services()
27+
->set('.ux_icons.cache')
28+
->parent('cache.system')
29+
->private()
30+
->tag('cache.pool')
31+
2732
->set('.ux_icons.cache_icon_registry', CacheIconRegistry::class)
2833
->args([
2934
service('.ux_icons.chain_registry'),
30-
service('cache.system'),
35+
service('.ux_icons.cache'),
3136
])
3237

3338
->set('.ux_icons.local_svg_icon_registry', LocalSvgIconRegistry::class)

src/Icons/src/Iconify.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function chunk(string $prefix, array $names): iterable
196196

197197
private function sets(): \ArrayObject
198198
{
199-
return $this->sets ??= $this->cache->get('ux-iconify-sets', function () {
199+
return $this->sets ??= $this->cache->get('iconify-sets', function () {
200200
$response = $this->http->request('GET', '/collections');
201201

202202
return new \ArrayObject($response->toArray());

src/Icons/src/Registry/CacheIconRegistry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function get(string $name, bool $refresh = false): Icon
3434
}
3535

3636
return $this->cache->get(
37-
\sprintf('ux-icon-%s', Icon::nameToId($name)),
37+
Icon::nameToId($name),
3838
fn () => $this->inner->get($name),
3939
beta: $refresh ? \INF : null,
4040
);

0 commit comments

Comments
 (0)