This commit is contained in:
yanweidong
2026-02-10 20:14:55 +08:00
parent 7adf85acbe
commit 4aaafd2fd2
2 changed files with 26 additions and 2 deletions

View File

@@ -14,15 +14,18 @@ func Boot() {
os.MkdirAll("./markdata/", 0755)
}
//首次先运行
UpdateTask()
scheduler := cron.New()
// 每天运行3次来更新数据
scheduler.AddFunc("30 18 * * *", func() {
updateTask()
UpdateTask()
})
scheduler.Start()
}
func updateTask() {
func UpdateTask() {
a.NewApiClient()
// 获取股票列表
a.GetStockBasic()