feat(market-data): 迁移 Tushare 同步到 PostgreSQL
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
"""Environment-backed application configuration."""
|
||||
|
||||
from decimal import Decimal
|
||||
from functools import lru_cache
|
||||
from pathlib import Path
|
||||
from typing import Literal
|
||||
|
||||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
@@ -12,6 +14,15 @@ class Settings(BaseSettings):
|
||||
app_name: str = "Zhixing Server"
|
||||
app_env: Literal["development", "test", "production"] = "development"
|
||||
log_level: str = "INFO"
|
||||
database_url: str = "postgresql://zhixing:zhixing@localhost:5432/zhixing"
|
||||
tushare_token: str = ""
|
||||
market_data_csv_root: Path = Path("./data/market-data")
|
||||
market_data_coverage_threshold: Decimal = Decimal("0.99")
|
||||
market_data_max_workers: int = 4
|
||||
market_data_request_interval_seconds: float = 0.2
|
||||
market_data_max_retries: int = 3
|
||||
market_data_retry_backoff_seconds: float = 1.0
|
||||
market_data_advisory_lock_key: int = 7_380_521
|
||||
|
||||
model_config = SettingsConfigDict(
|
||||
env_file=".env",
|
||||
|
||||
Reference in New Issue
Block a user