Archived
fix: 修复了一些bug并将剩余的同步代码改为异步执行
This commit is contained in:
6 files changed
+29
-24
No files matched your search
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user