Skip to content

Commit

Permalink
🐛 Slack source connector: do not give up retry attempts if there is 4…
Browse files Browse the repository at this point in the history
…29 error (#5708)

* Slack source connector: increase retry attempts to 20.
  • Loading branch information
avida committed Sep 2, 2021
1 parent 58c9b84 commit 19c8efd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
9 changes: 8 additions & 1 deletion airbyte-integrations/connectors/source-slack/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,19 @@

from setuptools import find_packages, setup

TEST_REQUIREMENTS = [
"pytest~=6.1",
]

setup(
name="source_slack",
description="Source implementation for Slack.",
author="Airbyte",
author_email="contact@airbyte.io",
packages=find_packages(),
install_requires=["airbyte-cdk", "pytest==6.1.2", "slack_sdk==3.4.2", "pendulum>=2,<3"],
install_requires=["airbyte-cdk~=0.1.13", "slack_sdk==3.4.2", "pendulum>=2,<3"],
package_data={"": ["*.json"]},
extras_require={
"tests": TEST_REQUIREMENTS,
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ class SlackStream(HttpStream, ABC):
primary_key = "id"
page_size = 100

@property
def max_retries(self) -> int:
# Slack's rate limiting can be unpredictable so we increase the max number of retries by a lot before failing
return 20

def next_page_token(self, response: requests.Response) -> Optional[Mapping[str, Any]]:
"""Slack uses a cursor-based pagination strategy.
Extract the cursor from the response if it exists and return it in a format
Expand Down

0 comments on commit 19c8efd

Please sign in to comment.