Skip to content

Commit

Permalink
Change cache by aiocache for support async chached functions
Browse files Browse the repository at this point in the history
  • Loading branch information
falvaradorodriguez committed Jan 10, 2025
1 parent 0e469d4 commit 63579a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/services/data_decoder.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions requirements/prod.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 63579a4

Please sign in to comment.