Skip to content

Commit

Permalink
Replace lru cache with SimpleCache
Browse files Browse the repository at this point in the history
  • Loading branch information
prathmeshranaut committed Apr 25, 2023
1 parent 09baffc commit c130f00
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions newsfragments/2884.internal.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Replaced lru cache with simple cache and removed lru-dict dependency.
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
"eth-utils>=2.1.0",
"hexbytes>=0.1.0",
"jsonschema>=4.0.0",
"lru-dict>=1.1.6",
"protobuf>=4.21.6",
"pywin32>=223;platform_system=='Windows'",
"requests>=2.16.0",
Expand Down
3 changes: 1 addition & 2 deletions web3/middleware/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from eth_utils import (
is_list_like,
)
import lru

from web3._utils.caching import (
generate_cache_key,
Expand Down Expand Up @@ -193,7 +192,7 @@ def middleware(method: RPCEndpoint, params: Any) -> RPCResponse:


_time_based_cache_middleware = construct_time_based_cache_middleware(
cache_class=functools.partial(lru.LRU, 256),
cache_class=functools.partial(SimpleCache, 256),
)


Expand Down

0 comments on commit c130f00

Please sign in to comment.