Alter ensure_sync implementation to support extensions
This allows extensions to override the Flask.ensure_sync method and have the change apply to blueprints as well. Without this change it is possible for differing blueprints to have differing ensure_sync approaches depending on the extension used - which would likely result in event-loop blocking issues. This also allows blueprints to have a custom ensure_sync, although this is a by product rather than an expected use case.
This commit is contained in:
parent
c6c6408c3f
commit
00f5a3e55c
5 changed files with 169 additions and 32 deletions
|
|
@ -755,6 +755,7 @@ def run_async(func):
|
|||
ctx module, except it has an async inner.
|
||||
"""
|
||||
ctx = None
|
||||
|
||||
if _request_ctx_stack.top is not None:
|
||||
ctx = _request_ctx_stack.top.copy()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue