diff --git a/app/services/data_decoder.py b/app/services/data_decoder.py index e3a269c..e59fac5 100644 --- a/app/services/data_decoder.py +++ b/app/services/data_decoder.py @@ -1,7 +1,7 @@ import logging -from functools import cache from typing import Any, AsyncIterator, NotRequired, TypedDict, Union, cast +from aiocache import cached from async_lru import alru_cache from eth_abi import decode as decode_abi from eth_abi.exceptions import DecodingError @@ -54,7 +54,7 @@ class MultisendDecoded(TypedDict): data_decoded: DataDecoded | None -@cache +@cached(ttl=60 * 5) @database_session async def get_data_decoder_service(session: AsyncSession) -> "DataDecoderService": data_decoder_service = DataDecoderService() diff --git a/requirements/prod.txt b/requirements/prod.txt index f1da2b7..45ad863 100644 --- a/requirements/prod.txt +++ b/requirements/prod.txt @@ -1,4 +1,5 @@ aio-pika==9.5.4 +aiocache==0.12.3 alembic==1.14.0 async-lru==2.0.4 asyncpg==0.30.0