copy_current_request_context
Decorate a function to run inside the current request context. This can be used when starting a background task, otherwise it will not see the app and request objects that were active in the parent.
def copy_current_request_context(
f: F
) - > F
Decorate a function to run inside the current request context. This can be used when starting a background task, otherwise it will not see the app and request objects that were active in the parent.
Parameters
| Name | Type | Description |
|---|---|---|
| f | F | The function to be decorated and run within the copied request context. |
Returns
| Type | Description |
|---|---|
F | The decorated function that will execute within a copy of the request context. |