Refactor dotenv loading in config.py to simplify environment variable management by removing the fallback logic and directly loading the .env file.

This commit is contained in:
2026-01-15 21:11:09 +08:00
parent 7e4a6874a2
commit 62c470b3de

View File

@@ -9,13 +9,7 @@ from pathlib import Path
from dataclasses import dataclass, field from dataclasses import dataclass, field
from dotenv import load_dotenv from dotenv import load_dotenv
# Load .env from sibling project (BTC_spot_MVRV) load_dotenv()
ENV_PATH = Path(__file__).parent.parent.parent / "BTC_spot_MVRV" / ".env"
if ENV_PATH.exists():
load_dotenv(ENV_PATH)
else:
# Fallback to local .env
load_dotenv()
@dataclass @dataclass