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 Recharge: improve 'backoff' for HTTP requests #7626

Merged
merged 6 commits into from
Nov 8, 2021
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 @@ -2,6 +2,6 @@
"sourceDefinitionId": "45d2e135-2ede-49e1-939f-3e3ec357a65e",
"name": "Recharge",
"dockerRepository": "airbyte/source-recharge",
"dockerImageTag": "0.1.3",
"dockerImageTag": "0.1.4",
"documentationUrl": "https://docs.airbyte.io/integrations/sources/recharge"
}
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@
- name: Recharge
sourceDefinitionId: 45d2e135-2ede-49e1-939f-3e3ec357a65e
dockerRepository: airbyte/source-recharge
dockerImageTag: 0.1.3
dockerImageTag: 0.1.4
documentationUrl: https://docs.airbyte.io/integrations/sources/recharge
sourceType: api
- name: Recurly
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-recharge/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.3
LABEL io.airbyte.version=0.1.4
LABEL io.airbyte.name=airbyte/source-recharge
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,15 @@ def get_stream_data(self, response_data: Any) -> List[dict]:
else:
return [response_data]

def should_retry(self, response: requests.Response) -> bool:
res = super().should_retry(response)
if res:
return res

# For some reason, successful responses contains incomplete data
content_length = int(response.headers.get("Content-Length", 0))
return response.status_code == 200 and content_length > len(response.content)


class IncrementalRechargeStream(RechargeStream, ABC):

Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/recharge.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Please read [How to generate your API token](https://support.rechargepayments.co

| Version | Date | Pull Request | Subject |
| :--- | :--- | :--- | :--- |
| 0.1.4 | 2021-11-05 | [7626](https://github.com/airbytehq/airbyte/pull/7626) | Improve 'backoff' for HTTP requests |
| 0.1.3 | 2021-09-17 | [6149](https://github.com/airbytehq/airbyte/pull/6149) | Update `discount` and `order` schema |
| 0.1.2 | 2021-09-17 | [6149](https://github.com/airbytehq/airbyte/pull/6149) | Change `cursor_field` for Incremental streams |
| | | | |
Expand Down