fix bug
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"git.apinb.com/quant/collector/internal/conf"
|
||||
"github.com/robfig/cron/v3"
|
||||
)
|
||||
|
||||
@@ -16,15 +17,26 @@ var (
|
||||
COLLECTION_INTERVAL = 30
|
||||
)
|
||||
|
||||
func Boot() {
|
||||
func Boot(cfg *conf.Config) {
|
||||
log.Println("=== QMT数据采集器启动 ===")
|
||||
|
||||
log.Printf("采集地址: %s", COLLECTOR_URL)
|
||||
log.Printf("采集间隔: %d秒", COLLECTION_INTERVAL)
|
||||
|
||||
if cfg == nil {
|
||||
log.Println("配置为空")
|
||||
return
|
||||
}
|
||||
|
||||
log.Printf("账户: %s", cfg.Account)
|
||||
log.Printf("账户ID: %s", cfg.AccountID)
|
||||
log.Printf("主机名: %s", cfg.Hostname)
|
||||
|
||||
// 创建采集器
|
||||
coll := NewCollector(COLLECTOR_URL)
|
||||
|
||||
// 启动时检查并补全订单簿数据
|
||||
CheckAndRepairOrderBooks(cfg.AccountID)
|
||||
|
||||
// 创建cron调度器
|
||||
c := cron.New(cron.WithSeconds())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user