mirror of
https://github.com/Murasame-Dev/McStatus-Img.git
synced 2025-12-16 21:27:58 +00:00
Update main.py
Co-authored-by: quqiOnfree <quqiOnfree@outlook.com>
This commit is contained in:
parent
7eb0dba03a
commit
8857a0ca63
1 changed files with 2 additions and 1 deletions
3
main.py
3
main.py
|
|
@ -27,7 +27,8 @@ async def get_icon_image(url: str):
|
||||||
def read_file(path):
|
def read_file(path):
|
||||||
with open(path, "rb") as f:
|
with open(path, "rb") as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
return await asyncio.to_thread(read_file, url)
|
loop = asyncio.get_event_loop()
|
||||||
|
return await loop.run_in_executor(None, read_file, url)
|
||||||
|
|
||||||
async def generate_java_status_image(addr: str):
|
async def generate_java_status_image(addr: str):
|
||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue