Skip to content

Commit

Permalink
[Core] Increase default timeout to the re-usable async client (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tankilevitch authored Jan 11, 2024
1 parent 54ec165 commit af053b5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@ this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

<!-- towncrier release notes start -->

## 0.4.16 (2024-01-11)


### Improvements

- Increased the default timeout for requests to 3rd party targets to 30 seconds, and made it configurable (PORT-6074)


## 0.4.15 (2024-01-07)


Expand Down
1 change: 1 addition & 0 deletions port_ocean/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def validate_lower(cls, v: str) -> str:
class IntegrationConfiguration(BaseOceanSettings, extra=Extra.allow):
initialize_port_resources: bool = True
scheduled_resync_interval: int | None = None
client_timeout: int = 30
port: PortSettings
event_listener: EventListenerSettingsType
integration: IntegrationSettings
3 changes: 2 additions & 1 deletion port_ocean/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from werkzeug.local import LocalStack, LocalProxy

from port_ocean.helpers.async_client import OceanAsyncClient
from port_ocean.context.ocean import ocean
from port_ocean.helpers.retry import RetryTransport

_http_client: LocalStack[httpx.AsyncClient] = LocalStack()
Expand All @@ -26,7 +27,7 @@
def _get_http_client_context() -> httpx.AsyncClient:
client = _http_client.top
if client is None:
client = OceanAsyncClient(RetryTransport)
client = OceanAsyncClient(RetryTransport, timeout=ocean.config.client_timeout)
_http_client.push(client)

return client
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[tool.poetry]
name = "port-ocean"
version = "0.4.15"
version = "0.4.16"
description = "Port Ocean is a CLI tool for managing your Port projects."
readme = "README.md"
homepage = "https://app.getport.io"
repository = "https://github.com/port-labs/Port-Ocean"

authors = ["Daniel Sinai <[email protected]>", "Yair Siman-Tov <[email protected]>"]
authors = ["Daniel Sinai <[email protected]>", "Yair Siman-Tov <[email protected]>", "Tom Tankilevitch <[email protected]>"]
packages = [
{ include = "port_ocean", from = "." }
]
Expand Down

0 comments on commit af053b5

Please sign in to comment.