Skip to content

Commit

Permalink
fix(ingest/slack): Add retries (#12401)
Browse files Browse the repository at this point in the history
  • Loading branch information
pedro93 authored Jan 23, 2025
1 parent 61ed948 commit 3030f90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion metadata-ingestion/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@

powerbi_report_server = {"requests", "requests_ntlm"}

slack = {"slack-sdk==3.18.1"}
slack = {"slack-sdk==3.18.1", "tenacity>=8.0.1",}

databricks = {
# 0.1.11 appears to have authentication issues with azure databricks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

from pydantic import Field, SecretStr
from slack_sdk import WebClient
from tenacity import retry, wait_exponential
from tenacity.before_sleep import before_sleep_log

import datahub.emitter.mce_builder as builder
from datahub.configuration.common import ConfigModel
Expand Down Expand Up @@ -294,6 +296,10 @@ def populate_slack_id_from_email(self, user_obj: CorpUser) -> None:
return
raise e

@retry(
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 3030f90

Please sign in to comment.