Skip to content

Commit ececd21

Browse files
committed
fix: parse ES_TIMEOUT env var to int
1 parent 4139cb4 commit ececd21

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ services:
2020
- ES_PORT=9200
2121
- ES_USE_SSL=false
2222
- ES_VERIFY_CERTS=false
23+
- ES_TIMEOUT=30
2324
- BACKEND=elasticsearch
2425
- DATABASE_REFRESH=true
2526
- ENABLE_COLLECTIONS_SEARCH_ROUTE=true
@@ -60,6 +61,7 @@ services:
6061
- ES_PORT=9202
6162
- ES_USE_SSL=false
6263
- ES_VERIFY_CERTS=false
64+
- ES_TIMEOUT=30
6365
- BACKEND=opensearch
6466
- STAC_FASTAPI_RATE_LIMIT=200/minute
6567
- ENABLE_COLLECTIONS_SEARCH_ROUTE=true

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def _es_config() -> Dict[str, Any]:
5858

5959
# Include timeout setting if set
6060
if request_timeout := os.getenv("ES_TIMEOUT"):
61-
config["request_timeout"] = request_timeout
61+
config["request_timeout"] = int(request_timeout)
6262

6363
# Explicitly exclude SSL settings when not using SSL
6464
if not use_ssl:

stac_fastapi/opensearch/stac_fastapi/opensearch/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def _es_config() -> Dict[str, Any]:
5656

5757
# Include timeout setting if set
5858
if timeout := os.getenv("ES_TIMEOUT"):
59-
config["timeout"] = timeout
59+
config["timeout"] = int(timeout)
6060

6161
# Explicitly exclude SSL settings when not using SSL
6262
if not use_ssl:

0 commit comments

Comments
 (0)