Files
pig-farm-controller/config.yml
huang 810049d62e 1. 增加任务调度器配置文件
2. 创建/更新计划会自动处理触发器
2025-09-17 23:01:15 +08:00

55 lines
2.0 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 应用基础配置
app:
name: "pig-farm-controller"
version: "1.0.0"
# JWT 密钥,用于签发和验证 token。请在生产环境中替换为更复杂的密钥
jwt_secret: "pig-farm-controller"
# HTTP 服务配置
server:
port: 8086
mode: "debug" # Gin 运行模式: "debug", "release", "test"
# 日志配置
log:
level: "info" # 日志级别: "debug", "info", "warn", "error", "dpanic", "panic", "fatal"
format: "console" # 日志格式: "console" 或 "json"
enable_file: true # 是否启用文件日志
file_path: "./app_logs/app.log" # 日志文件路径
max_size: 10 # 每个日志文件的最大尺寸 (MB)
max_backups: 5 # 保留的旧日志文件的最大数量
max_age: 30 # 保留的旧日志文件的最大天数
compress: false # 是否压缩/归档旧日志文件
# 数据库配置 (PostgreSQL)
database:
host: "huangwc.com"
port: 5432
username: "pig-farm-controller"
password: "pig-farm-controller"
dbname: "pig-farm-controller"
sslmode: "disable" # 在生产环境中建议使用 "require"
max_open_conns: 25 # 最大开放连接数
max_idle_conns: 10 # 最大空闲连接数
conn_max_lifetime: 600 # 连接最大生命周期(秒)
# WebSocket 配置 (如果使用)
websocket:
timeout: 60 # WebSocket请求超时时间(秒)
heartbeat_interval: 30 # 心跳检测间隔(秒)
# 心跳/定时任务配置
heartbeat:
interval: 600 # 任务调度或心跳检查的默认间隔(秒)
concurrency: 2 # 执行任务的并发协程数
# chirp_stack 配置文件
chirp_stack:
api_host: "http://192.168.5.16:8090" # ChirpStack API服务器地址
api_token: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJjaGlycHN0YWNrIiwiaXNzIjoiY2hpcnBzdGFjayIsInN1YiI6IjU2ZWRhNWQ3LTM4NzgtNDAwMC05MWMzLWYwZDk3M2YwODhjNiIsInR5cCI6ImtleSJ9.NxBxTrhPAnezKMqAYZR_Uq2mGQjJRlmVzg1ZDFCyaHQ" # ChirpStack API密钥, 请求头中需要设置 Grpc-Metadata-Authorization: Bearer <YOUR_API_TOKEN>
api_timeout: 10 # ChirpStack API请求超时时间(秒)
# 任务调度器配置
task:
interval: 3
num_workers: 5