Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REQUEST_TIMEOUT Env Var #541

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading