Skip to content

Commit 8191862

Browse files
Yuri ZmytrakovYuri Zmytrakov
authored andcommitted
add redis
1 parent b87e9c0 commit 8191862

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

stac_fastapi/core/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"pygeofilter~=0.3.1",
2020
"jsonschema~=4.0.0",
2121
"slowapi~=0.1.9",
22+
"redis==6.4.0",
2223
]
2324

2425
setup(

stac_fastapi/core/stac_fastapi/core/core.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
add_previous_link,
2929
cache_current_url,
3030
cache_previous_url,
31-
connect_redis_sentinel,
3231
connect_redis,
3332
)
3433
from stac_fastapi.core.serializers import CollectionSerializer, ItemSerializer
@@ -265,9 +264,7 @@ async def all_collections(self, **kwargs) -> stac_types.Collections:
265264
},
266265
]
267266

268-
await add_previous_link(
269-
redis, links, "collections", current_url, token
270-
)
267+
await add_previous_link(redis, links, "collections", current_url, token)
271268
if redis:
272269
await cache_previous_url(redis, current_url, "collections")
273270

stac_fastapi/core/stac_fastapi/core/redis_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ async def connect_redis_sentinel(
9191

9292
redis_pool = master
9393

94-
except:
94+
except Exception:
9595
return None
9696

9797
return redis_pool

stac_fastapi/tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
import pytest
88
import pytest_asyncio
9+
import redis # noqa: F401
910
from fastapi import Depends, HTTPException, security, status
1011
from httpx import ASGITransport, AsyncClient
1112
from pydantic import ConfigDict

0 commit comments

Comments
 (0)