-
-
Notifications
You must be signed in to change notification settings - Fork 454
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix cache compatibility with cache pools #1360
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I confirm this fixes the issue. |
I had the same issue :) Now works again :) |
@nicolas-grekas can you help with a test case? I wonder why this doesn't trigger the issue public function testCacheConfigUsingCachePools(): void
{
$this->expectNotToPerformAssertions();
(new class () extends TestKernel {
public function registerContainerConfiguration(LoaderInterface $loader): void
{
parent::registerContainerConfiguration($loader);
$loader->load(static function (ContainerBuilder $containerBuilder): void {
$containerBuilder->loadFromExtension('framework', [
'cache' => [
'pools' => [
'doctrine.result_cache_pool' => ['adapter' => 'cache.app'],
'doctrine.system_cache_pool' => ['adapter' => 'cache.system'],
],
],
]);
$containerBuilder->loadFromExtension(
'doctrine',
['orm' => [
'query_cache_driver' => ['type' => 'service', 'id' => 'custom_cache_service'],
'result_cache_driver' => ['type' => 'pool', 'id' => 'doctrine.result_cache_pool'],
]]
);
$containerBuilder->setDefinition(
'custom_cache_service',
(new Definition(DoctrineProvider::class))
->setArguments([new Definition(ArrayAdapter::class)])
->setFactory([DoctrineProvider::class, 'wrap'])
);
});
}
})->boot();
} |
@ostrolucky this reproduces it for me public function testCacheConfigUsingCachePools(): void
{
(new class () extends TestKernel {
public function registerContainerConfiguration(LoaderInterface $loader): void
{
parent::registerContainerConfiguration($loader);
$loader->load(static function (ContainerBuilder $containerBuilder): void {
$containerBuilder->loadFromExtension('framework', [
'cache' => [
'pools' => [
'doctrine.result_cache_pool' => ['adapter' => 'cache.adapter.filesystem'],
],
],
]);
$containerBuilder->loadFromExtension(
'doctrine',
['orm' => [
'result_cache_driver' => ['type' => 'pool', 'pool' => 'doctrine.result_cache_pool'],
]]
);
});
}
})->boot();
} - 'result_cache_driver' => ['type' => 'pool', 'id' => 'doctrine.result_cache_pool'],
+ 'result_cache_driver' => ['type' => 'pool', 'pool' => 'doctrine.result_cache_pool'], |
ostrolucky
force-pushed
the
fix-cache-pools-compatibility
branch
from
June 1, 2021 18:08
511418f
to
9cc34c6
Compare
dmaicher
approved these changes
Jun 1, 2021
Thanks @dmaicher, I'm tired today |
ostrolucky
force-pushed
the
fix-cache-pools-compatibility
branch
from
June 1, 2021 18:33
9cc34c6
to
cc8b8ae
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Somehow I cannot trigger the issue via a test, help welcome there.