forked from orbit-oss/flask
copy_current_request_context can decorate async functions
This commit is contained in:
parent
6b0c8cdac1
commit
47e4bd5059
2 changed files with 4 additions and 1 deletions
|
|
@ -169,7 +169,7 @@ def copy_current_request_context(f: t.Callable) -> t.Callable:
|
|||
|
||||
def wrapper(*args, **kwargs):
|
||||
with reqctx:
|
||||
return f(*args, **kwargs)
|
||||
return reqctx.app.ensure_sync(f)(*args, **kwargs)
|
||||
|
||||
return update_wrapper(wrapper, f)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue