From 8857a0ca6350d4ad0fbb1da1a82cf29dcdac6a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=AE=E3=83=AA=E7=8C=AB?= Date: Tue, 26 Aug 2025 22:26:51 +0800 Subject: [PATCH] Update main.py Co-authored-by: quqiOnfree --- main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 5d712f9..3ef5ed9 100644 --- a/main.py +++ b/main.py @@ -27,7 +27,8 @@ async def get_icon_image(url: str): def read_file(path): with open(path, "rb") as f: 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): loop = asyncio.get_event_loop()