f329f647c7
Co-authored-by: Cursor <cursoragent@cursor.com>
39 lines
1.4 KiB
Python
39 lines
1.4 KiB
Python
"""运行参数。可用环境变量或项目根目录的 .env 覆盖。"""
|
|
|
|
from decimal import Decimal
|
|
|
|
from pydantic_settings import BaseSettings, SettingsConfigDict
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
database_url: str = "sqlite:///./depin.db"
|
|
# 超过该时长没有心跳,节点会被置为 offline。
|
|
heartbeat_timeout_minutes: int = 15
|
|
# 在线巡检周期。
|
|
offline_check_minutes: int = 5
|
|
# 随机任务下发周期、单轮最多下发数量,以及节点必须回传的时限。
|
|
task_dispatch_minutes: int = 5
|
|
dispatch_batch_size: int = 20
|
|
task_deadline_minutes: int = 10
|
|
# 当日既有在线样本又有任务样本时的权重。两者默认相加为 1。
|
|
online_weight: Decimal = Decimal("0.7")
|
|
task_weight: Decimal = Decimal("0.3")
|
|
# 每日清算时刻。默认北京时间凌晨 00:05,入账的是上一个已结束的 UTC 账本日。
|
|
yield_timezone: str = "Asia/Shanghai"
|
|
yield_hour: int = 0
|
|
yield_minute: int = 5
|
|
license_months: int = 12
|
|
license_price: Decimal = Decimal("1500")
|
|
license_asset: str = "USDT"
|
|
disable_scheduler: bool = False
|
|
jwt_secret: str = ""
|
|
jwt_expire_minutes: int = 60 * 24
|
|
admin_username: str = "admin"
|
|
admin_password: str = ""
|
|
admin_wallet: str = "admin-root"
|
|
|
|
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
|
|
|
|
|
|
settings = Settings()
|