Skip to content

Commit 238bdbb

Browse files
author
Adam Balogh
committed
fix cached
1 parent 81120e4 commit 238bdbb

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

onchain/tokens/metadata.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
from typing import Optional, List
55
import logging
66
import botocore
7-
from cachetools import TTLCache, LRUCache
7+
from cachetools import TTLCache, LRUCache, cached
88
from ratelimit import limits, sleep_and_retry
99
from ratelimit.exception import RateLimitException
1010
import time
11-
from cachetools import cachedmethod
12-
1311

1412
@dataclass
1513
class TokenMetadata:
@@ -46,7 +44,7 @@ def __init__(self, tokens_table):
4644
## Search token
4745
##
4846

49-
@cachedmethod(cache=TTLCache(maxsize=100_000, ttl=60 * 60))
47+
@cached(cache=TTLCache(maxsize=100_000, ttl=60 * 60))
5048
def search_token(self, token: str, chain: Optional[str]) -> Optional[TokenMetadata]:
5149
"""Search for a token by name or symbol."""
5250
# Check if token is a valid address

0 commit comments

Comments
 (0)