Skip to content

Commit f8547f3

Browse files
committed
Cache tag pool
1 parent 886766d commit f8547f3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

src/Core/Factory/CacheFactory.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,19 +50,26 @@ protected function getDefaultFactory(string $name, ...$args): mixed
5050
public static function createCachePool(
5151
string $storage,
5252
string|ObjectBuilderDefinition $serializer,
53+
string|\UnitEnum|null|false $tagStorage = false,
5354
) {
5455
return #[Factory]
5556
static function (
5657
Container $container,
5758
string|\UnitEnum|null $tag = null,
5859
) use (
5960
$storage,
60-
$serializer
61+
$serializer,
62+
$tagStorage,
6163
): CachePool {
64+
if ($tagStorage !== false && $tagStorage !== null) {
65+
$tagStorage = $container->get(StorageInterface::class, tag: $tagStorage);
66+
}
67+
6268
return new CachePool(
6369
$container->resolve(StorageInterface::class, ['cacheTag' => $tag], tag: $storage),
6470
$container->resolve($serializer),
65-
$container->get(LoggerInterface::class, tag: 'error')
71+
$container->get(LoggerInterface::class, tag: 'cache'),
72+
tagPool: $tagStorage
6673
);
6774
};
6875
}

0 commit comments

Comments
 (0)