Skip to content

Commit

Permalink
fix(slack source): Add retries to pulling information from DataHub
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro93 committed Jan 20, 2025
1 parent 3108b53 commit ecd160d
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
import textwrap
from dataclasses import dataclass
from typing import Iterable, List, Optional, Tuple
from tenacity import retry, wait_exponential
from tenacity.before_sleep import before_sleep_log

Check warning on line 6 in metadata-ingestion/src/datahub/ingestion/source/slack/slack.py

View check run for this annotation

Codecov / codecov/patch

metadata-ingestion/src/datahub/ingestion/source/slack/slack.py#L5-L6

Added lines #L5 - L6 were not covered by tests

from pydantic import Field, SecretStr
from slack_sdk import WebClient
Expand Down Expand Up @@ -294,6 +296,10 @@ def populate_slack_id_from_email(self, user_obj: CorpUser) -> None:
return
raise e

@retry(

Check warning on line 299 in metadata-ingestion/src/datahub/ingestion/source/slack/slack.py

View check run for this annotation

Codecov / codecov/patch

metadata-ingestion/src/datahub/ingestion/source/slack/slack.py#L299

Added line #L299 was not covered by tests
wait=wait_exponential(multiplier=2, min=4, max=60),
before_sleep=before_sleep_log(logger, logging.ERROR, True)
)
def get_user_to_be_updated(self) -> Iterable[CorpUser]:
graphql_query = textwrap.dedent(
"""
Expand Down

0 comments on commit ecd160d

Please sign in to comment.