diff --git a/Makefile b/Makefile index df90240..104cff8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -IMAGE_TAG ?= docker.educg.net/cg/k8s-manager:v1.1.0 +IMAGE_TAG ?= docker.educg.net/cg/k8s-manager:v1.1.1 build: export CGO_ENABLED=0 build: export GOOS=linux diff --git a/main.go b/main.go index f6814a2..ed1f6c0 100644 --- a/main.go +++ b/main.go @@ -164,6 +164,7 @@ func Test(c *gin.Context) { c.Abort() return } + log.WithField("user name", username).Info("Login success.") c.SetCookie("Authorization", "Bearer "+token, 0, "", "", false, false) c.Header("Authorization", "Bearer "+token) c.Header("Cache-Control", "no-store") diff --git a/src/orm.go b/src/orm.go index cf1605e..2f00370 100644 --- a/src/orm.go +++ b/src/orm.go @@ -56,6 +56,7 @@ func checkdb(cnt int) *gorm.DB { if err != nil { logrus.WithError(err).Errorf("Close error %d.", cnt) } + instance = nil ans = nil } } @@ -67,5 +68,6 @@ func DB() *gorm.DB { if ans != nil { return ans } + instance = nil return checkdb(2) }