-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
Proposal how to fix TODO #5
Comments
Hi @Toflar, thanks for the idea! Most of the time the command would work fine without early exit. But when flushing the Flow framework caches including reflection classes I encountered random exceptions during the shutdown phase of the framework. So going back to the controller with an exception doesn't solve it or I didn't fully understand what you meant. But after playing around it looks like the errors I encountered came from the persistence layer. So I tried clearing the persistence state after flushing, and so far I didn't encounter further errors when flushing all caches and returning a proper response. So I will play with it for a few days and see if it actually works now :) But I'm curious how you found this little todo? |
The exception seemed to happen during persistence shutdown so clearing its state seemed to solve it. Resolves: #5
I guess I'm trying to take my Neos Award jury seat seriously ;-) That's how I found it and I thought I might as well drop a few lines while I'm here :-) |
I'm don't know why exactly you have to stop script execution here:
Shel.Neos.Terminal/Classes/Command/FlushCacheCommand.php
Line 73 in bf3f1e7
But I assume there are technical reasons for it. I've encountered the same in the past and I've solved it by throwing a custom exception which you can then catch in the controller.
Not aborting the script execution has a few advantages:
Content-Length
header like it is now ;-)Just as an idea ;-) Over at Contao we even built a
ResponseException
which takes a Symfony HttpFoundationResponse
as argument so you can send a proper response from within legacy code :-)The text was updated successfully, but these errors were encountered: