Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source Bing Ads: Fix: limit cache size for ServiceClient #17505

Merged
merged 4 commits into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
- name: Bing Ads
sourceDefinitionId: 47f25999-dd5e-4636-8c39-e7cea2453331
dockerRepository: airbyte/source-bing-ads
dockerImageTag: 0.1.14
dockerImageTag: 0.1.15
documentationUrl: https://docs.airbyte.io/integrations/sources/bing-ads
icon: bingads.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1460,7 +1460,7 @@
- "overwrite"
- "append"
- "append_dedup"
- dockerImage: "airbyte/source-bing-ads:0.1.14"
- dockerImage: "airbyte/source-bing-ads:0.1.15"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/bing-ads"
connectionSpecification:
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-bing-ads/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ RUN pip install .
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.14
LABEL io.airbyte.version=0.1.15
LABEL io.airbyte.name=airbyte/source-bing-ads
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def _get_auth_client(self, client_id: str, tenant_id: str, client_secret: str =
auth_creds["client_secret"] = client_secret
return OAuthWebAuthCodeGrant(**auth_creds)

@lru_cache(maxsize=None)
@lru_cache(maxsize=4)
def _get_auth_data(self, customer_id: str = None, account_id: Optional[str] = None) -> AuthorizationData:
return AuthorizationData(
account_id=account_id,
Expand Down Expand Up @@ -147,7 +147,7 @@ def _request(

return getattr(service, operation_name)(**params)

@lru_cache(maxsize=None)
@lru_cache(maxsize=4)
def get_service(
self,
service_name: str,
Expand All @@ -161,7 +161,7 @@ def get_service(
environment=self.environment,
)

@lru_cache(maxsize=16)
@lru_cache(maxsize=4)
def _get_reporting_service(
self,
customer_id: Optional[str] = None,
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/bing-ads.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ The Bing Ads API limits the number of requests for all Microsoft Advertising cli
## Changelog
| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------- |
| 0.1.15 | 2022-10-03 | [17505](https://github.com/airbytehq/airbyte/pull/17505) | Fix: limit cache size for ServiceClient instances |
| 0.1.14 | 2022-09-29 | [17403](https://github.com/airbytehq/airbyte/pull/17403) | Fix: limit cache size for ReportingServiceManager instances |
| 0.1.13 | 2022-09-29 | [17386](https://github.com/airbytehq/airbyte/pull/17386) | Migrate to per-stream states. |
| 0.1.12 | 2022-09-05 | [16335](https://github.com/airbytehq/airbyte/pull/16335) | Added backoff for socket.timeout |
Expand Down