6464REQUEST_TIMEOUT = 408
6565SERVER_ERROR = 500
6666
67+ DEFAULT_RESPONSE_TIMEOUT = 5.0 # seconds
68+
6769_default_logger = logging .getLogger ("aea.packages.valory.connections.http_server" )
6870
6971RequestId = DialogueLabel
@@ -371,8 +373,6 @@ async def disconnect(self) -> None:
371373class HTTPChannel (BaseAsyncChannel ):
372374 """A wrapper for an RESTful API with an internal HTTPServer."""
373375
374- RESPONSE_TIMEOUT = 5.0
375-
376376 def __init__ ( # pylint: disable=too-many-positional-arguments
377377 self ,
378378 address : Address ,
@@ -381,7 +381,7 @@ def __init__( # pylint: disable=too-many-positional-arguments
381381 target_skill_id : PublicId ,
382382 api_spec_path : Optional [str ],
383383 connection_id : PublicId ,
384- timeout_window : float = RESPONSE_TIMEOUT ,
384+ timeout_window : float ,
385385 logger : logging .Logger = _default_logger ,
386386 ssl_cert_path : Optional [str ] = None ,
387387 ssl_key_path : Optional [str ] = None ,
@@ -570,6 +570,10 @@ def __init__(self, **kwargs: Any) -> None:
570570 super ().__init__ (** kwargs )
571571 host = cast (Optional [str ], self .configuration .config .get ("host" ))
572572 port = cast (Optional [int ], self .configuration .config .get ("port" ))
573+ timeout = cast (
574+ float ,
575+ self .configuration .config .get ("timeout" , DEFAULT_RESPONSE_TIMEOUT ),
576+ )
573577 target_skill_id_ = cast (
574578 Optional [str ], self .configuration .config .get ("target_skill_id" )
575579 )
@@ -594,6 +598,7 @@ def __init__(self, **kwargs: Any) -> None:
594598 target_skill_id ,
595599 api_spec_path ,
596600 connection_id = self .connection_id ,
601+ timeout_window = timeout ,
597602 logger = self .logger ,
598603 ssl_cert_path = ssl_cert_path ,
599604 ssl_key_path = ssl_key_path ,
0 commit comments