Skip to content

Conversation

@stayallive
Copy link
Collaborator

@stayallive stayallive commented Jul 30, 2024

Because out middleware is a singleton resolved in the boot of the framework it never get's detroyed so any state remains forever, this caused the terminating callback to only be registered for one request and subsequent requests did not get a new terminating callback registered. To fix this I moved the registering of the callback to a class we keep as a singleton so we know if the container was reset and this ensure the callback is only registered once per container lifecycle and re-registers it as needed for Octane.

Fixes #935

This also works fine on normal Laravel applications. Lumen never used this method anyway since app()->terminating() isn't a thing there.

@stayallive stayallive self-assigned this Jul 30, 2024
@stayallive stayallive marked this pull request as ready for review August 5, 2024 14:29
@stayallive stayallive requested a review from cleptric August 5, 2024 14:30
@stayallive stayallive merged commit 72b6731 into master Aug 8, 2024
@stayallive stayallive deleted the octane-fixes branch August 8, 2024 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants