Skip to content

Optional copy_current_request_context #52

Description

@tandu

Can you add an option to config for optional copy_current_request_context? I don't need this context in my functions. I'm running a background thread on server launch where request context doesn't exist yet. So it throws an error and I don't see any other way to fix this.
i.e.
change this:

fn = copy_current_request_context(fn)

to something like this:

if current_app.config[self.EXECUTOR_PUSH_REQUEST_CONTEXT]:
    fn = copy_current_request_context(fn)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions