Commit 602ef24d by 朱继来

调整发票公司脚本

parent c0c4dfc0
Showing with 4 additions and 12 deletions
...@@ -51,18 +51,9 @@ func main() { ...@@ -51,18 +51,9 @@ func main() {
//初始化db //初始化db
initDb(util.Configs.Liexin_databases.Dns) initDb(util.Configs.Liexin_databases.Dns)
//t1 := time.NewTimer(time.Second * 10) updateData()
t1 := time.NewTimer(time.Hour * 12) // 定时12小时
fmt.Println("任务执行成功")
for {
select {
case <-t1.C:
fmt.Println("ticker...")
updateData()
//t1.Reset(time.Second * 10)
t1.Reset(time.Hour * 12)
}
}
} }
// 修改DB // 修改DB
...@@ -129,6 +120,7 @@ func updateData() (err error) { ...@@ -129,6 +120,7 @@ func updateData() (err error) {
} }
row.Close()
return return
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment