I've found some similar questions but couldn't find what I want.
I have async function which is I want to use it inside my celery task but cannot call it with await inside task. Is there any way to do it?
db.py
async def select_users():
sql = "SELECT * FROM Users WHERE "
sql, parameters = self.format_args(sql, parameters=kwargs)
return await self.execute(sql, *parameters, fetchrow=True)
tasks.py
from .celery import app
import db
@app.task
def update_credits():
users = db.select_users() #here I should call func with 'await'
print(users)