From e52fcebfaf181b645e6209b2a17a8d69b3211822 Mon Sep 17 00:00:00 2001 From: austnv Date: Sun, 14 Jun 2026 23:37:52 +0300 Subject: [PATCH] fix: incorrect use asyncio.thread -> remove --- routers/tariffs.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/routers/tariffs.py b/routers/tariffs.py index a297066..17d021a 100644 --- a/routers/tariffs.py +++ b/routers/tariffs.py @@ -1,7 +1,6 @@ from fastapi import APIRouter import aiofiles import json -import asyncio from async_lru import alru_cache router = APIRouter(prefix='/api/v1', tags=['tariffs']) @@ -10,7 +9,7 @@ router = APIRouter(prefix='/api/v1', tags=['tariffs']) async def get_tariffs_from_file(): async with aiofiles.open('data/tariffs.json', 'r', encoding='utf-8') as f: content = await f.read() - return await asyncio.to_thread(json.loads(content)) + return json.loads(content) # <- блокирующая операция, но с маленьким контентом + кэш @router.get('/tariffs') async def get_tariffs():