From e5197550d82cfb7a8784899fff435e96ed026ef9 Mon Sep 17 00:00:00 2001 From: liuxiaolong <liuxiaolong@aiotlink.com> Date: 星期二, 11 八月 2020 11:20:55 +0800 Subject: [PATCH] add syncperson from hik --- main.go | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/main.go b/main.go index 7679f46..ccff92d 100644 --- a/main.go +++ b/main.go @@ -4,7 +4,9 @@ "car-service/controllers" "car-service/models" _ "car-service/routers" + "car-service/service" "github.com/astaxie/beego" + "github.com/robfig/cron" ) func main() { @@ -15,5 +17,11 @@ models.InitDb() controllers.Schedule() go controllers.ComputeSpaceLeftRealTime() + //姣忓ぉ鍚屾娴峰悍鏁版嵁锛岀湅浜哄憳id鏄惁鏈夊彂鐢熷彉鍖� + c := cron.New() + c.AddFunc("@daily", func() { + service.SyncHikPerson() + }) + c.Start() beego.Run() } -- Gitblit v1.8.0