Skip to content

Commit 51395ac

Browse files
Merge branch 'main' into CAT-1522
2 parents 379ea80 + 983fedd commit 51395ac

File tree

9 files changed

+22
-47
lines changed

9 files changed

+22
-47
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1919

2020
### Updated
2121

22+
## [v6.7.1] - 2025-10-31
23+
24+
### Fixed
25+
26+
- Ensure `REDIS_MAX_CONNECTION` can accept `None` and integer value for default number of connection. [#515](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/pull/515)
27+
2228
## [v6.7.0] - 2025-10-27
2329

2430
### Added
@@ -611,7 +617,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
611617
- Use genexp in execute_search and get_all_collections to return results.
612618
- Added db_to_stac serializer to item_collection method in core.py.
613619

614-
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.0...main
620+
[Unreleased]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.1...main
621+
[v6.7.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.7.0...v6.7.1
615622
[v6.7.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.6.0...v6.7.0
616623
[v6.6.0]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.5.1...v6.6.0
617624
[v6.5.1]: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch/compare/v6.5.0...v6.5.1

stac_fastapi/core/stac_fastapi/core/redis_utils.py

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from typing import List, Optional, Tuple
66
from urllib.parse import parse_qs, urlencode, urlparse, urlunparse
77

8-
from pydantic import field_validator
8+
from pydantic import Field, field_validator
99
from pydantic_settings import BaseSettings
1010
from redis import asyncio as aioredis
1111
from redis.asyncio.sentinel import Sentinel
@@ -21,11 +21,11 @@ class RedisSentinelSettings(BaseSettings):
2121
REDIS_SENTINEL_MASTER_NAME: str = "master"
2222
REDIS_DB: int = 15
2323

24-
REDIS_MAX_CONNECTIONS: int = 10
24+
REDIS_MAX_CONNECTIONS: Optional[int] = None
2525
REDIS_RETRY_TIMEOUT: bool = True
2626
REDIS_DECODE_RESPONSES: bool = True
2727
REDIS_CLIENT_NAME: str = "stac-fastapi-app"
28-
REDIS_HEALTH_CHECK_INTERVAL: int = 30
28+
REDIS_HEALTH_CHECK_INTERVAL: int = Field(default=30, gt=0)
2929
REDIS_SELF_LINK_TTL: int = 1800
3030

3131
@field_validator("REDIS_DB")
@@ -36,22 +36,6 @@ def validate_db_sentinel(cls, v: int) -> int:
3636
raise ValueError("REDIS_DB must be a positive integer")
3737
return v
3838

39-
@field_validator("REDIS_MAX_CONNECTIONS")
40-
@classmethod
41-
def validate_max_connections_sentinel(cls, v: int) -> int:
42-
"""Validate REDIS_MAX_CONNECTIONS is at least 1."""
43-
if v < 1:
44-
raise ValueError("REDIS_MAX_CONNECTIONS must be at least 1")
45-
return v
46-
47-
@field_validator("REDIS_HEALTH_CHECK_INTERVAL")
48-
@classmethod
49-
def validate_health_check_interval_sentinel(cls, v: int) -> int:
50-
"""Validate REDIS_HEALTH_CHECK_INTERVAL is not negative integer."""
51-
if v < 0:
52-
raise ValueError("REDIS_HEALTH_CHECK_INTERVAL must be a positive integer")
53-
return v
54-
5539
@field_validator("REDIS_SELF_LINK_TTL")
5640
@classmethod
5741
def validate_self_link_ttl_sentinel(cls, v: int) -> int:
@@ -111,11 +95,11 @@ class RedisSettings(BaseSettings):
11195
REDIS_PORT: int = 6379
11296
REDIS_DB: int = 15
11397

114-
REDIS_MAX_CONNECTIONS: int = 10
98+
REDIS_MAX_CONNECTIONS: Optional[int] = None
11599
REDIS_RETRY_TIMEOUT: bool = True
116100
REDIS_DECODE_RESPONSES: bool = True
117101
REDIS_CLIENT_NAME: str = "stac-fastapi-app"
118-
REDIS_HEALTH_CHECK_INTERVAL: int = 30
102+
REDIS_HEALTH_CHECK_INTERVAL: int = Field(default=30, gt=0)
119103
REDIS_SELF_LINK_TTL: int = 1800
120104

121105
@field_validator("REDIS_PORT")
@@ -134,22 +118,6 @@ def validate_db_standalone(cls, v: int) -> int:
134118
raise ValueError("REDIS_DB must be a positive integer")
135119
return v
136120

137-
@field_validator("REDIS_MAX_CONNECTIONS")
138-
@classmethod
139-
def validate_max_connections_standalone(cls, v: int) -> int:
140-
"""Validate REDIS_MAX_CONNECTIONS is at least 1."""
141-
if v < 1:
142-
raise ValueError("REDIS_MAX_CONNECTIONS must be at least 1")
143-
return v
144-
145-
@field_validator("REDIS_HEALTH_CHECK_INTERVAL")
146-
@classmethod
147-
def validate_health_check_interval_standalone(cls, v: int) -> int:
148-
"""Validate REDIS_HEALTH_CHECK_INTERVAL is not a negative."""
149-
if v < 0:
150-
raise ValueError("REDIS_HEALTH_CHECK_INTERVAL must be a positive integer")
151-
return v
152-
153121
@field_validator("REDIS_SELF_LINK_TTL")
154122
@classmethod
155123
def validate_self_link_ttl_standalone(cls, v: int) -> int:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "6.7.0"
2+
__version__ = "6.7.1"

stac_fastapi/elasticsearch/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ keywords = [
3030
]
3131
dynamic = ["version"]
3232
dependencies = [
33-
"stac-fastapi-core==6.7.0",
34-
"sfeos-helpers==6.7.0",
33+
"stac-fastapi-core==6.7.1",
34+
"sfeos-helpers==6.7.1",
3535
"elasticsearch[async]~=8.19.1",
3636
"uvicorn~=0.23.0",
3737
"starlette>=0.35.0,<0.36.0",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "6.7.0"
2+
__version__ = "6.7.1"

stac_fastapi/opensearch/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ keywords = [
3030
]
3131
dynamic = ["version"]
3232
dependencies = [
33-
"stac-fastapi-core==6.7.0",
34-
"sfeos-helpers==6.7.0",
33+
"stac-fastapi-core==6.7.1",
34+
"sfeos-helpers==6.7.1",
3535
"opensearch-py~=2.8.0",
3636
"opensearch-py[async]~=2.8.0",
3737
"uvicorn~=0.23.0",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "6.7.0"
2+
__version__ = "6.7.1"

stac_fastapi/sfeos_helpers/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ keywords = [
3131
]
3232
dynamic = ["version"]
3333
dependencies = [
34-
"stac-fastapi.core==6.7.0",
34+
"stac-fastapi.core==6.7.1",
3535
]
3636

3737
[project.urls]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
"""library version."""
2-
__version__ = "6.7.0"
2+
__version__ = "6.7.1"

0 commit comments

Comments
 (0)