Skip to content

Commit 5daf1b9

Browse files
Robert Szeflerarikalon1
andauthored
Configurable slack request timeout (#1464)
Co-authored-by: arik <[email protected]>
1 parent 6046af2 commit 5daf1b9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/robusta/core/model/env_vars.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ def load_bool(env_var, default: bool):
6969

7070
TELEMETRY_PERIODIC_SEC = int(os.environ.get("TELEMETRY_PERIODIC_SEC", 60 * 60 * 24)) # 24H
7171

72+
SLACK_REQUEST_TIMEOUT = int(os.environ.get("SLACK_REQUEST_TIMEOUT", 90))
7273
SLACK_TABLE_COLUMNS_LIMIT = int(os.environ.get("SLACK_TABLE_COLUMNS_LIMIT", 3))
7374
DISCORD_TABLE_COLUMNS_LIMIT = int(os.environ.get("DISCORD_TABLE_COLUMNS_LIMIT", 4))
7475
RSA_KEYS_PATH = os.environ.get("RSA_KEYS_PATH", "/etc/robusta/auth")

src/robusta/integrations/slack/sender.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from slack_sdk.errors import SlackApiError
1313

1414
from robusta.core.model.base_params import AIInvestigateParams, ResourceInfo
15-
from robusta.core.model.env_vars import ADDITIONAL_CERTIFICATE, HOLMES_ENABLED, SLACK_TABLE_COLUMNS_LIMIT
15+
from robusta.core.model.env_vars import ADDITIONAL_CERTIFICATE, SLACK_REQUEST_TIMEOUT, HOLMES_ENABLED, SLACK_TABLE_COLUMNS_LIMIT
1616
from robusta.core.playbooks.internal.ai_integration import ask_holmes
1717
from robusta.core.reporting.base import Emojis, EnrichmentType, Finding, FindingStatus
1818
from robusta.core.reporting.blocks import (
@@ -61,7 +61,7 @@ def __init__(self, slack_token: str, account_id: str, cluster_name: str, signing
6161
except Exception as e:
6262
logging.exception(f"Failed to use custom certificate. {e}")
6363

64-
self.slack_client = WebClient(token=slack_token, ssl=ssl_context)
64+
self.slack_client = WebClient(token=slack_token, ssl=ssl_context, timeout=SLACK_REQUEST_TIMEOUT)
6565
self.signing_key = signing_key
6666
self.account_id = account_id
6767
self.cluster_name = cluster_name

0 commit comments

Comments
 (0)