optz COLLECTION_INTERVAL

This commit is contained in:
2026-04-17 13:11:19 +08:00
parent af8135d45d
commit a0a6d6adaa

View File

@@ -20,7 +20,7 @@ func main() {
// 从环境变量获取配置
collectorURL := getEnv("COLLECTOR_URL", "http://localhost:5000/status")
dbConnStr := getEnv("DATABASE_URL", "host=139.224.247.176 user=postgres password=Stock0310~! dbname=stock_prod port=19432 sslmode=disable TimeZone=Asia/Shanghai")
interval := getEnvAsInt("COLLECTION_INTERVAL", 60) // 默认60秒
interval := getEnvAsInt("COLLECTION_INTERVAL", 30) // 默认60秒
log.Printf("采集地址: %s", collectorURL)
log.Printf("采集间隔: %d秒", interval)