Skip to content

Commit cfa80a3

Browse files
authored
do nothing on empty queue
1 parent 0b769fc commit cfa80a3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/SymfonyCache/KernelDispatcher.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,14 @@ public function invalidate(RequestInterface $invalidationRequest, $validateHost
9090
*/
9191
public function flush()
9292
{
93+
if (!count($this->queue)) {
94+
return 0;
95+
}
9396
$queue = $this->queue;
9497
$this->queue = [];
9598

9699
$exceptions = new ExceptionCollection();
97-
98100
$httpCache = $this->httpCacheProvider->getHttpCache();
99-
100101
if (null === $httpCache) {
101102
throw new ProxyUnreachableException('Kernel did not return a HttpCache instance. Did you forget $kernel->setHttpCache($cacheKernel) in your front controller?');
102103
}

0 commit comments

Comments
 (0)