Skip to content

Commit 0d2be20

Browse files
committed
Better clear doctrine cache
1 parent ff7bcda commit 0d2be20

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/Command/CacheFlushCommand.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,21 @@ private function clearCacheForType($type)
7373

7474
$config = $this->getContainer()->getParameter(sprintf('cache.%s', $type));
7575

76+
if ($type === 'doctrine') {
77+
$this->doClearCache($type, $config['metadata']['service_id']);
78+
$this->doClearCache($type, $config['result']['service_id']);
79+
$this->doClearCache($type, $config['query']['service_id']);
80+
} else {
81+
$this->doClearCache($type, $config['service_id']);
82+
}
83+
}
84+
85+
/**
86+
* @param $type
87+
* @param $serviceId
88+
*/
89+
private function doClearCache($type, $serviceId)
90+
{
7691
/** @type CacheItemPoolInterface $service */
7792
$service = $this->getContainer()->get($config['service_id']);
7893
if ($service instanceof TaggablePoolInterface) {

0 commit comments

Comments
 (0)