register system cache clearer only if it's used

This commit is contained in:
Christian Flothmann 2017-12-07 17:10:25 +01:00
parent 22a6a7e4c5
commit 093eb3d40d
2 changed files with 5 additions and 3 deletions

View File

@ -112,6 +112,10 @@ class CachePoolPass implements CompilerPassInterface
$clearer->setArgument(0, $pools);
}
$clearer->addTag('cache.pool.clearer');
if ('cache.system_clearer' === $id) {
$clearer->addTag('kernel.cache_clearer');
}
}
}

View File

@ -104,9 +104,7 @@
<argument type="collection" />
</service>
<service id="cache.system_clearer" parent="cache.default_clearer" public="true">
<tag name="kernel.cache_clearer" />
</service>
<service id="cache.system_clearer" parent="cache.default_clearer" public="true" />
<service id="cache.global_clearer" parent="cache.default_clearer" public="true" />
<service id="cache.app_clearer" alias="cache.default_clearer" public="true" />