Skip to content

do nothing on empty queue #439

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

Merged
merged 1 commit into from
Oct 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ Changelog

See also the [GitHub releases page](https://github.com/FriendsOfSymfony/FOSHttpCache/releases).

2.5.4
-----

### Symfony HttpCache

* Fixed: Avoid regression of 2.5.3: If there are no messages to be dispatched,
do not throw an exception if the HttpCache is not set.

2.5.3
-----

Expand Down
5 changes: 3 additions & 2 deletions src/SymfonyCache/KernelDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,14 @@ public function invalidate(RequestInterface $invalidationRequest, $validateHost
*/
public function flush()
{
if (!count($this->queue)) {
return 0;
}
$queue = $this->queue;
$this->queue = [];

$exceptions = new ExceptionCollection();

$httpCache = $this->httpCacheProvider->getHttpCache();

if (null === $httpCache) {
throw new ProxyUnreachableException('Kernel did not return a HttpCache instance. Did you forget $kernel->setHttpCache($cacheKernel) in your front controller?');
}
Expand Down