From fd0a09ff32641324259ccf5da19014d95042b40c Mon Sep 17 00:00:00 2001 From: xwzQmxx <1499273991@qq.com> Date: Mon, 9 Nov 2020 09:49:58 +0800 Subject: [PATCH] fix issue I224AJJ Check log output --- pkg/cibot/clahandler.go | 4 ++-- pkg/cibot/database/database.go | 2 -- pkg/cibot/oauth.go | 4 ++-- pkg/cibot/server.go | 3 --- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pkg/cibot/clahandler.go b/pkg/cibot/clahandler.go index 9dfaf6e..57fa3b1 100644 --- a/pkg/cibot/clahandler.go +++ b/pkg/cibot/clahandler.go @@ -292,7 +292,7 @@ func (s *CLAHandler) HandleRequest(w http.ResponseWriter, request CLARequest, ac } // tostring - data, err := cds.ToString() + _, err = cds.ToString() if err != nil { s.HandleResult(w, CLAResult{ IsSuccess: false, @@ -301,7 +301,7 @@ func (s *CLAHandler) HandleRequest(w http.ResponseWriter, request CLARequest, ac }) return } - glog.Infof("add cla details data: %s", data) + // Check email in database var lenEmail int diff --git a/pkg/cibot/database/database.go b/pkg/cibot/database/database.go index c7b2b04..1558854 100644 --- a/pkg/cibot/database/database.go +++ b/pkg/cibot/database/database.go @@ -47,8 +47,6 @@ func ConnectDataBase(config config.Config) (*gorm.DB, error) { config.DataBaseHost, config.DataBasePort, config.DataBaseName) - glog.Infof("connecting str: %v", connStr) - return gorm.Open(config.DataBaseType, connStr) } diff --git a/pkg/cibot/oauth.go b/pkg/cibot/oauth.go index d6e9983..9469da9 100644 --- a/pkg/cibot/oauth.go +++ b/pkg/cibot/oauth.go @@ -3,10 +3,10 @@ package cibot import ( "context" "fmt" + "github.com/golang/glog" "os" "strings" - "github.com/golang/glog" "golang.org/x/oauth2" ) @@ -30,7 +30,7 @@ func GetToken(code string) (*oauth2.Token, error) { ctx := context.Background() config := Setup(client, redirect, secret) - glog.Infof("Token request config : %v, code: %s", config, code) + glog.Infof("Token request config, code: %s", code) return config.Exchange(ctx, code) diff --git a/pkg/cibot/server.go b/pkg/cibot/server.go index 3ec09ff..d45e633 100644 --- a/pkg/cibot/server.go +++ b/pkg/cibot/server.go @@ -28,9 +28,6 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) { fmt.Fprint(w, err.Error()) return } - // pstr := string(payload) - // glog.Infof("payload: %v", pstr) - // parse into Event messagetype := gitee.WebHookType(r) glog.Infof("message type: %v", messagetype) -- Gitee