From c6caf128002a1c0929aa7464ba5ae1f0dd968e7c Mon Sep 17 00:00:00 2001
From: liuxiaolong <liuxiaolong@aiotlink.com>
Date: 星期四, 13 八月 2020 11:38:39 +0800
Subject: [PATCH] fix init restriction
---
controllers/restriction.go | 2 +-
main.go | 1 +
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/controllers/restriction.go b/controllers/restriction.go
index 45a819c..36e716e 100644
--- a/controllers/restriction.go
+++ b/controllers/restriction.go
@@ -18,7 +18,7 @@
beego.Controller
}
-func init() {
+func InitRestriction() {
date := time.Now().Format("2006-01-02")
var r models.Restriction
err := r.SelectByDate(date)
diff --git a/main.go b/main.go
index ccff92d..6b31762 100644
--- a/main.go
+++ b/main.go
@@ -15,6 +15,7 @@
beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"
}
models.InitDb()
+ controllers.InitRestriction()
controllers.Schedule()
go controllers.ComputeSpaceLeftRealTime()
//姣忓ぉ鍚屾娴峰悍鏁版嵁锛岀湅浜哄憳id鏄惁鏈夊彂鐢熷彉鍖�
--
Gitblit v1.8.0