Skip to content

Commit

Permalink
REQUEST_TIMEOUT Env Var (#541)
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanpulver committed Jun 28, 2024
1 parent 14efd0d commit f15d790
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions safety/constants.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# -*- coding: utf-8 -*-
import configparser
import os
from enum import Enum
from pathlib import Path
from typing import Optional


JSON_SCHEMA_VERSION = '2.0.0'

# TODO fix this
Expand All @@ -15,8 +15,8 @@
DIR_NAME = ".safety"

def get_system_dir() -> Path:
import sys
import os
import sys
raw_dir = os.getenv("SAFETY_SYSTEM_CONFIG_PATH")
app_data = os.environ.get('ALLUSERSPROFILE', None)

Expand Down Expand Up @@ -98,7 +98,8 @@ def get_config_setting(name: str) -> Optional[str]:
DATA_API_BASE_URL
]

REQUEST_TIMEOUT = 30
# Fetch the REQUEST_TIMEOUT from the environment variable, defaulting to 30 if not set
REQUEST_TIMEOUT = int(os.getenv("SAFETY_REQUEST_TIMEOUT", 30))

# Colors
YELLOW = 'yellow'
Expand All @@ -122,19 +123,19 @@ def get_config_setting(name: str) -> Optional[str]:
MSG_NO_AUTHD_CICD_PROD_STG_ORG = \
f"""
Login to get your API key
To log in: [link]{{LOGIN_URL}}[/link]
Read more at: [link]{DOCS_API_KEY_URL}[/link]
"""

MSG_NO_AUTHD_NOTE_CICD_PROD_STG_TPL = \
f"""
Login or register for a free account to get your API key
To log in: [link]{{LOGIN_URL}}[/link]
To register: [link]{{SIGNUP_URL}}[/link]
Read more at: [link]{DOCS_API_KEY_URL}[/link]
"""

Expand Down

0 comments on commit f15d790

Please sign in to comment.