fix: 修复了一些bug并将剩余的同步代码改为异步执行

This commit is contained in:
RTAkland
2022-12-22 18:10:02 +08:00
parent ad055cf6fe
commit ce009e0203
6 files changed
+29 -24

No files matched your search

+3 -2
View File
@@ -18,7 +18,8 @@ async def resp(_id: str, length: int = 7, theme: str = 'lewd') -> dict:
:param theme: theme for counter
:return:
"""
times = Database().query(_id)[1]
result = await Database().query(_id)
times = result[1]
str_number = str(times) # 将整形转换为字符串
len_number = len(str_number) # 再获取字符串长度
g_length = length * '0' # 根据输入的位数来生成0的数量
@@ -26,7 +27,7 @@ async def resp(_id: str, length: int = 7, theme: str = 'lewd') -> dict:
context = []
headers = {'cache-control': 'max-age=0, no-cache, no-store, must-revalidate',
'Content-Type': 'image/svg+xml; charset=utf-8'}
data = Database().query_image(theme)
data = await Database().query_image(theme)
height = data[0][-1]
width = data[0][-2]
counter = 0