Skip to content

Commit

Permalink
Configurable slack request timeout (#1464)
Browse files Browse the repository at this point in the history
Co-authored-by: arik <[email protected]>
  • Loading branch information
Robert Szefler and arikalon1 authored Jun 24, 2024
1 parent 6046af2 commit 5daf1b9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/robusta/core/model/env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def load_bool(env_var, default: bool):

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

SLACK_REQUEST_TIMEOUT = int(os.environ.get("SLACK_REQUEST_TIMEOUT", 90))
SLACK_TABLE_COLUMNS_LIMIT = int(os.environ.get("SLACK_TABLE_COLUMNS_LIMIT", 3))
DISCORD_TABLE_COLUMNS_LIMIT = int(os.environ.get("DISCORD_TABLE_COLUMNS_LIMIT", 4))
RSA_KEYS_PATH = os.environ.get("RSA_KEYS_PATH", "/etc/robusta/auth")
Expand Down
4 changes: 2 additions & 2 deletions src/robusta/integrations/slack/sender.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from slack_sdk.errors import SlackApiError

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

self.slack_client = WebClient(token=slack_token, ssl=ssl_context)
self.slack_client = WebClient(token=slack_token, ssl=ssl_context, timeout=SLACK_REQUEST_TIMEOUT)
self.signing_key = signing_key
self.account_id = account_id
self.cluster_name = cluster_name
Expand Down

0 comments on commit 5daf1b9

Please sign in to comment.