Skip to content

Commit

Permalink
fix locking lru-dict
Browse files Browse the repository at this point in the history
  • Loading branch information
droserasprout committed Nov 11, 2023
1 parent 4721488 commit bc3ceb5
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 43 deletions.
69 changes: 36 additions & 33 deletions pdm.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,14 @@ dependencies = [
"datamodel-code-generator~=0.22.0",
"pydantic~=1.10.11",
"tortoise-orm==0.19.3",

"aiohttp~=3.8",
"aiolimiter~=1.0",
"anyio~=3.3",
"APScheduler~=3.8",
"async-lru~=2.0",
"asyncclick~=8.0",
"eth-abi~=4.0",
"lru-dict~=1.2",
"lru-dict~=1.3.0",
"orjson~=3.9",
"prometheus-client~=0.17",
"pyarrow>=14.0.1,<15",
Expand Down
4 changes: 2 additions & 2 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jinja2==3.1.2
jsonschema==4.17.3
jsonschema-spec==0.1.6
lazy-object-proxy==1.9.0
lru-dict==1.2.0
lru-dict==1.3.0
MarkupSafe==2.1.3
msgpack==1.0.5
multidict==6.0.4
Expand Down Expand Up @@ -121,7 +121,7 @@ typing-extensions==4.7.1
tzlocal==5.0.1
urllib3==2.0.6
watchdog==3.0.0
web3==6.11.3
web3==6.11.2
websocket-client==1.6.1
websockets==10.4
yarl==1.9.2
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jinja2==3.1.2
jsonschema==4.17.3
jsonschema-spec==0.1.6
lazy-object-proxy==1.9.0
lru-dict==1.2.0
lru-dict==1.3.0
MarkupSafe==2.1.3
msgpack==1.0.5
multidict==6.0.4
Expand Down Expand Up @@ -90,6 +90,6 @@ tortoise-orm==0.19.3
typing-extensions==4.7.1
tzlocal==5.0.1
urllib3==2.0.6
web3==6.11.3
web3==6.11.2
websockets==10.4
yarl==1.9.2
4 changes: 2 additions & 2 deletions src/demo_uniswap/models/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Any
from typing import cast

from lru import LRU # type: ignore[import-not-found]
from lru import LRU

import demo_uniswap.models as models
from dipdup.config.evm import EvmContractConfig
Expand Down Expand Up @@ -32,7 +32,7 @@ def save_pending_position(self, idx: str, position: dict[str, Any]) -> None:
self._pending_positions[idx] = position

def get_pending_position(self, idx: str) -> dict[str, Any] | None:
return self._pending_positions.get(idx, None) # type: ignore[no-any-return]
return self._pending_positions.get(idx, None)


async def get_ctx_factory(ctx: HandlerContext) -> models.Factory:
Expand Down
4 changes: 2 additions & 2 deletions src/dipdup/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from typing import cast

from async_lru import alru_cache
from lru import LRU # type: ignore[import-not-found]
from lru import LRU

from dipdup.exceptions import FrameworkException

Expand Down Expand Up @@ -115,7 +115,7 @@ def add_model(

try:
maxsize = cls.Meta.maxsize # type: ignore[attr-defined]
self._model[cls.__name__] = LRU(maxsize)
self._model[cls.__name__] = LRU(maxsize) # type: ignore[assignment]
except AttributeError:
self._model[cls.__name__] = {}

Expand Down

0 comments on commit bc3ceb5

Please sign in to comment.