Implemented default pipeline
This commit is contained in:
@@ -6,7 +6,6 @@ using simple os.getenv() approach without external validation libraries.
|
||||
"""
|
||||
|
||||
import os
|
||||
from typing import Optional
|
||||
|
||||
|
||||
def get_mongodb_url() -> str:
|
||||
@@ -31,6 +30,26 @@ def get_mongodb_database_name() -> str:
|
||||
return os.getenv("MONGODB_DATABASE", "mydocmanager")
|
||||
|
||||
|
||||
def get_redis_url() -> str:
|
||||
return os.getenv("REDIS_URL", "redis://localhost:6379/0")
|
||||
|
||||
|
||||
# def get_redis_host() -> str:
|
||||
# redis_url = get_redis_url()
|
||||
# if redis_url.startswith("redis://"):
|
||||
# return redis_url.split("redis://")[1].split("/")[0]
|
||||
# else:
|
||||
# return redis_url
|
||||
#
|
||||
#
|
||||
# def get_redis_port() -> int:
|
||||
# redis_url = get_redis_url()
|
||||
# if redis_url.startswith("redis://"):
|
||||
# return int(redis_url.split("redis://")[1].split("/")[0].split(":")[1])
|
||||
# else:
|
||||
# return int(redis_url.split(":")[1])
|
||||
|
||||
|
||||
def get_jwt_secret_key() -> str:
|
||||
"""
|
||||
Get JWT secret key from environment variables.
|
||||
@@ -82,4 +101,19 @@ def is_development_environment() -> bool:
|
||||
Returns:
|
||||
bool: True if development environment
|
||||
"""
|
||||
return os.getenv("ENVIRONMENT", "development").lower() == "development"
|
||||
return os.getenv("ENVIRONMENT", "development").lower() == "development"
|
||||
|
||||
|
||||
def get_objects_folder() -> str:
|
||||
"""
|
||||
Get Vault path from environment variables.
|
||||
|
||||
Returns:
|
||||
str: Vault path
|
||||
"""
|
||||
return os.getenv("OBJECTS_FOLDER", "/objects")
|
||||
|
||||
|
||||
def watch_directory() -> str:
|
||||
"""Directory to monitor for new files"""
|
||||
return os.getenv("WATCH_DIRECTORY", "/watched_files")
|
||||
|
||||
Reference in New Issue
Block a user