Commit 07294145 by 孙龙

up

parent c77aa319
Showing with 5 additions and 3 deletions
...@@ -93,7 +93,9 @@ func Callback(ctx *gin.Context) (err error){ ...@@ -93,7 +93,9 @@ func Callback(ctx *gin.Context) (err error){
sql := " insert into lie_async_task (callback_domain,callback_uri,request_type,data,method,service_type,create_time,is_http_json,header,remark,callback_func) values (?,?,?,?,?,?,?,?,?,?,?) " sql := " insert into lie_async_task (callback_domain,callback_uri,request_type,data,method,service_type,create_time,is_http_json,header,remark,callback_func) values (?,?,?,?,?,?,?,?,?,?,?) "
//fmt.Println(sql) //fmt.Println(sql)
session := http.Dao.GetDb("async_task").NewSession() session := http.Dao.GetDb("async_task").NewSession()
defer session.Close() defer func() {
_ = session.Close()
}()
err = session.Begin() err = session.Begin()
if err != nil{ if err != nil{
return return
...@@ -113,7 +115,7 @@ func Callback(ctx *gin.Context) (err error){ ...@@ -113,7 +115,7 @@ func Callback(ctx *gin.Context) (err error){
if msg ,err :=json.Marshal(req); err == nil{ if msg ,err :=json.Marshal(req); err == nil{
//插入队列 //插入队列
addMsg(string(msg)) _ = addMsg(string(msg))
err = session.Commit() err = session.Commit()
}else{ }else{
err = session.Rollback() err = session.Rollback()
......
...@@ -19,7 +19,7 @@ func main(){ ...@@ -19,7 +19,7 @@ func main(){
flag.StringVar(&configPath, "config", "./config/dev/", "配置文件") flag.StringVar(&configPath, "config", "./config/dev/", "配置文件")
flag.StringVar(&logPath, "logdir", "./logs/", "日志文件存储目录") flag.StringVar(&logPath, "logdir", "./logs/", "日志文件存储目录")
flag.Parse() flag.Parse()
http.Init(configPath,logPath) _ = http.Init(configPath,logPath)
go func() { go func() {
router.HttpServerRun() router.HttpServerRun()
}() }()
......
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