mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 20:09:20 +08:00
fix: fix max_retries is hardcode (#33619)
This commit is contained in:
12
api/configs/middleware/cache/redis_config.py
vendored
12
api/configs/middleware/cache/redis_config.py
vendored
@@ -1,4 +1,4 @@
|
|||||||
from pydantic import Field, NonNegativeInt, PositiveFloat, PositiveInt
|
from pydantic import Field, NonNegativeInt, PositiveFloat, PositiveInt, field_validator
|
||||||
from pydantic_settings import BaseSettings
|
from pydantic_settings import BaseSettings
|
||||||
|
|
||||||
|
|
||||||
@@ -116,3 +116,13 @@ class RedisConfig(BaseSettings):
|
|||||||
description="Maximum connections in the Redis connection pool (unset for library default)",
|
description="Maximum connections in the Redis connection pool (unset for library default)",
|
||||||
default=None,
|
default=None,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@field_validator("REDIS_MAX_CONNECTIONS", mode="before")
|
||||||
|
@classmethod
|
||||||
|
def _empty_string_to_none_for_max_conns(cls, v):
|
||||||
|
"""Allow empty string in env/.env to mean 'unset' (None)."""
|
||||||
|
if v is None:
|
||||||
|
return None
|
||||||
|
if isinstance(v, str) and v.strip() == "":
|
||||||
|
return None
|
||||||
|
return v
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ class HttpRequestNode(Node[HttpRequestNodeData]):
|
|||||||
timeout=self._get_request_timeout(self.node_data),
|
timeout=self._get_request_timeout(self.node_data),
|
||||||
variable_pool=self.graph_runtime_state.variable_pool,
|
variable_pool=self.graph_runtime_state.variable_pool,
|
||||||
http_request_config=self._http_request_config,
|
http_request_config=self._http_request_config,
|
||||||
max_retries=0,
|
|
||||||
ssl_verify=self.node_data.ssl_verify,
|
ssl_verify=self.node_data.ssl_verify,
|
||||||
http_client=self._http_client,
|
http_client=self._http_client,
|
||||||
file_manager=self._file_manager,
|
file_manager=self._file_manager,
|
||||||
|
|||||||
Reference in New Issue
Block a user