Skip to content

Commit 2f40cea

Browse files
committed
Use asyncache to cache results of asyncio coroutines
See: https://github.com/hephex/asyncache
1 parent 9b94573 commit 2f40cea

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ pytest-cov = "*"
1515

1616
[packages]
1717
aiohttp = "*"
18+
asyncache = "*"
1819
cachetools = "*"
1920
fastapi = "*"
2021
gunicorn = "*"

app/services/location/csbs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import csv
33
from datetime import datetime
44

5-
from cachetools import TTLCache, cached
5+
from asyncache import cached
6+
from cachetools import TTLCache
67

78
from ...coordinates import Coordinates
89
from ...location.csbs import CSBSLocation

app/services/location/jhu.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import csv
33
from datetime import datetime
44

5-
from cachetools import TTLCache, cached
5+
from asyncache import cached
6+
from cachetools import TTLCache
67

78
from ...coordinates import Coordinates
89
from ...location import TimelinedLocation

0 commit comments

Comments
 (0)