The program needs to connect to the database,It is error.
it is ok
async def index():
red = Red()
r = await red.get_redis_pool()
user_num = 1
await r.hmset('index', {'user_num': user_num})
app.register_listener(index, "after_server_start")
it is error
async def index(request):
red = Red()
r = await red.get_redis_pool()
user_num = await User.find_users_num(request)
await r.hmset('index', {'user_num': user_num})
app.register_listener(index, "after_server_start")
AttributeError: ‘types.SimpleNamespace’ object has no attribute ‘session’