This commit is contained in:
yanweidong
2026-02-11 15:59:29 +08:00
parent 4aaafd2fd2
commit 142bed6ae1
2 changed files with 13 additions and 7 deletions

View File

@@ -14,14 +14,15 @@ func Boot() {
os.MkdirAll("./markdata/", 0755)
}
//首次先运行
UpdateTask()
scheduler := cron.New()
// 每天运行3次来更新数据
scheduler.AddFunc("30 18 * * *", func() {
scheduler.AddFunc("0 18 * * *", func() {
UpdateTask()
})
// 新增每天6点12点18点运行一次
scheduler.AddFunc("0 6,12,18 * * *", func() {
UpdateFinaTask()
})
scheduler.Start()
}
@@ -33,10 +34,14 @@ func UpdateTask() {
a.GetStockDaily()
// 获取股票指标
a.GetStockIndicator()
// 获取股票财务指标数据
a.GetFinaIndicator()
// 生成Markdown文件
a.GenMarkData()
// start strategy
utils.HttpGet("http://localhost:13499/start/strategy", time.Minute*60*3)
}
func UpdateFinaTask() {
a.NewApiClient()
// 获取股票财务指标数据
a.GetFinaIndicator()
}

View File

@@ -3,3 +3,4 @@
GOARCH=amd64 GOOS=linux go build -o ../builds/stock ./cmd/main/main.go
nohup ./stock > /data/app/logs/stock.log 2>&1 &
tail -f /data/app/logs/stock.log