Open
Conversation
If current_app is used directly, it fails to recognize configuration changes. I spent last hour investigating it in our setup where we use Flask with uwsgi and app instance is created later, in a function, not on global level code. This means that 'current_app' pointer is instantiated before QueryInspect object is created. Our code creates QueryInspect object with app object passed to init. And during after_request() call, self.app is not current_app (more precisely: `self.app is current_app` evaluates to False). The fix is very small and I can see no reason it could break QueryInspect - actually it makes it more explicit in using app instance passed in init, instead of relying on current_app.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If current_app is used directly, it fails to recognize configuration changes. I spent last hour investigating it in our setup where we use Flask with uwsgi and app instance is created later, in a function, not on global level code. This means that 'current_app' pointer is instantiated before QueryInspect object is created. Our code creates QueryInspect object with app object passed to init. And during after_request() call, self.app is not current_app (more precisely:
self.app is current_appevaluates to False).The fix is very small and I can see no reason it could break QueryInspect - actually it makes it more explicit in using app instance passed in init, instead of relying on current_app.