Skip to content

Commit 4bac5b2

Browse files
committed
Timeout setting for Opensearch and Elasticsearch
1 parent b057c51 commit 4bac5b2

File tree

2 files changed

+8
-0
lines changed
  • stac_fastapi
    • elasticsearch/stac_fastapi/elasticsearch
    • opensearch/stac_fastapi/opensearch

2 files changed

+8
-0
lines changed

stac_fastapi/elasticsearch/stac_fastapi/elasticsearch/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ def _es_config() -> Dict[str, Any]:
5656
if (u := os.getenv("ES_USER")) and (p := os.getenv("ES_PASS")):
5757
config["http_auth"] = (u, p)
5858

59+
# Include timeout setting if set
60+
if timeout := os.getenv("ES_TIMEOUT"):
61+
config["timeout"] = timeout
62+
5963
# Explicitly exclude SSL settings when not using SSL
6064
if not use_ssl:
6165
return config

stac_fastapi/opensearch/stac_fastapi/opensearch/config.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ def _es_config() -> Dict[str, Any]:
5353

5454
config["headers"] = headers
5555

56+
# Include timeout setting if set
57+
if timeout := os.getenv("ES_TIMEOUT"):
58+
config["timeout"] = timeout
59+
5660
# Explicitly exclude SSL settings when not using SSL
5761
if not use_ssl:
5862
return config

0 commit comments

Comments
 (0)