Skip to content

Unable to use positional arguments in the decorator for database_sync_to_async #1849

Answered by carltongibson
Kevv-J asked this question in Help!
Discussion options

You must be logged in to vote

Perhaps not with the decorator syntax... — but I'd have to dig in to look.

I'd imagine it would work as:

def foo():
    ...

foo = @database_sync_to_async(foo, thread_sensitive=settings.THREAD_SENSITIVE)

BUT thread_sensitive is specifically for database connections... AFAICS it should never be False.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@carltongibson
Comment options

@Kevv-J
Comment options

@carltongibson
Comment options

@Kevv-J
Comment options

@carltongibson
Comment options

Answer selected by Kevv-J
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help!
Labels
None yet
2 participants