feat: stage-isolated infrastructure — separate Postgres DBs, Redis DBs, and MinIO bucket prefixes per stage
This commit is contained in:
@@ -99,15 +99,21 @@ class RetentionConfig:
|
||||
|
||||
|
||||
# Map bucket names to RetentionConfig field names
|
||||
# Uses _bucket() so retention cleanup targets the correct stage-specific buckets
|
||||
def _bucket(name: str) -> str:
|
||||
"""Apply DEPLOY_STAGE prefix to a bucket name."""
|
||||
prefix = os.getenv("DEPLOY_STAGE", "")
|
||||
return f"{prefix}-{name}" if prefix else name
|
||||
|
||||
BUCKET_RETENTION_FIELDS: dict[str, str] = {
|
||||
"stonks-raw-market": "raw_market_days",
|
||||
"stonks-raw-news": "raw_news_days",
|
||||
"stonks-raw-filings": "raw_filings_days",
|
||||
"stonks-normalized": "normalized_days",
|
||||
"stonks-llm-prompts": "llm_prompts_days",
|
||||
"stonks-llm-results": "llm_results_days",
|
||||
"stonks-lakehouse": "lakehouse_days",
|
||||
"stonks-audit": "audit_days",
|
||||
_bucket("stonks-raw-market"): "raw_market_days",
|
||||
_bucket("stonks-raw-news"): "raw_news_days",
|
||||
_bucket("stonks-raw-filings"): "raw_filings_days",
|
||||
_bucket("stonks-normalized"): "normalized_days",
|
||||
_bucket("stonks-llm-prompts"): "llm_prompts_days",
|
||||
_bucket("stonks-llm-results"): "llm_results_days",
|
||||
_bucket("stonks-lakehouse"): "lakehouse_days",
|
||||
_bucket("stonks-audit"): "audit_days",
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user