Refa: convert download_img to async (#13477)

### What problem does this PR solve?

Convert download_img to async.

### Type of change

- [x] Refactoring
- [x] Performance Improvement
This commit is contained in:
Yongteng Lei
2026-03-09 19:00:17 +08:00
committed by GitHub
parent 52bcd98d29
commit 7484298c82
4 changed files with 14 additions and 10 deletions

View File

@@ -222,7 +222,7 @@ async def oauth_callback(channel):
if not users:
try:
try:
avatar = download_img(user_info.avatar_url)
avatar = await download_img(user_info.avatar_url)
except Exception as e:
logging.exception(e)
avatar = ""
@@ -317,7 +317,7 @@ async def github_callback():
# User isn't try to register
try:
try:
avatar = download_img(user_info["avatar_url"])
avatar = await download_img(user_info["avatar_url"])
except Exception as e:
logging.exception(e)
avatar = ""
@@ -421,7 +421,7 @@ async def feishu_callback():
# User isn't try to register
try:
try:
avatar = download_img(user_info["avatar_url"])
avatar = await download_img(user_info["avatar_url"])
except Exception as e:
logging.exception(e)
avatar = ""