Skip to content
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

Move delayed transaction finisher state out of middleware #936

Merged
merged 2 commits into from
Aug 8, 2024

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 merged commit 72b6731 into master Aug 8, 2024
24 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.7.1 stops reporting performance units when using Laravel Octane
2 participants