refactor: 重构数据库orm为异步 #I9MRQS

This commit is contained in:
insistence
2024-05-17 15:04:30 +08:00
parent 18103e3d38
commit 1972f1cb6d
52 changed files with 1414 additions and 1246 deletions

View File

@@ -18,7 +18,7 @@ async def get_captcha_image(request: Request):
register_enabled = True if await request.app.state.redis.get(
f"{RedisInitKeyConfig.SYS_CONFIG.get('key')}:sys.account.registerUser") == 'true' else False
session_id = str(uuid.uuid4())
captcha_result = CaptchaService.create_captcha_image_service()
captcha_result = await CaptchaService.create_captcha_image_service()
image = captcha_result[0]
computed_result = captcha_result[1]
await request.app.state.redis.set(f"{RedisInitKeyConfig.CAPTCHA_CODES.get('key')}:{session_id}", computed_result, ex=timedelta(minutes=2))